Tuesday, June 25, 2013
What is SGID and how to set SGID in Linux?
What is SGID?
SGID (Set Group ID up on execution) is a special type of file permissions given to a file/folder. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SGID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file group permissions to become member of that group to execute the file.
What is SUID and how to set SUID in Linux/Unix?
What is SUID and how to set it in Linux?
SUID (Set owner User ID up on execution) is a special type of file permissions given to a file. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SUID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file owner rather that the user who is running it
Monday, June 24, 2013
What is a sticky Bit and how to set it in Linux?
What is Sticky Bit?
Sticky Bit is mainly used on folders in order to avoid deletion of a folder and its content by other users though they having write permissions on the folder contents. If Sticky bit is enabled on a folder, the folder contents are deleted by only owner who created them and the root user. No one else can delete other users data in this folder(Where sticky bit is set). This
Friday, June 21, 2013
How to use SecureVault when WSO2 Carbon servers are started as background processes
SecureVault can be used to encrypt the plain-text passwords specified in various configurations files in WSO2 Carbon products. You can find more information about how to secure plain-text passwords using securevault in this blog written by Asela.
When you use SecureVault to encrypt the passwords as explained there, you are supposed to specify the primary keystore password at the server startup. However, this is not possible when you start the server as a background process.
This post summarizes the complete procedure of securing plain text passwords using secure vault and additional configurations when you start the server as a background process.
Suppose, we need to encrypt the LDAP ConnectionPassword value in CARBON_HOME/repository/conf/user-mgt.xml
When you use SecureVault to encrypt the passwords as explained there, you are supposed to specify the primary keystore password at the server startup. However, this is not possible when you start the server as a background process.
This post summarizes the complete procedure of securing plain text passwords using secure vault and additional configurations when you start the server as a background process.
Suppose, we need to encrypt the LDAP ConnectionPassword value in CARBON_HOME/repository/conf/user-mgt.xml
- Locate cipher-text.properties which can be found at CARBON_HOME/repository/conf/security directory
- Keep a back up of the cipher-text.properties file
- Now, remove all key-value pairs which have there by default in cipher-text.properties file.(In this example, we just need to encrypt ConnectionPassword value)
- Add the following line. Make sure to include your plain_text LDAP connection password in [plain_text_ldap_password]
UserStoreManager.Property.ConnectionPassword=[plain_text_ldap_password] - Locate ciphertool.sh script which can be found at CARBON_HOME/bin directory
- Run ciphertool.sh as follows
ciphertool.sh -Dconfigure
This will prompt "[Please Enter Primary KeyStore Password of Carbon Server : ]" message. Enter "wso2carbon" as the primary keystore password - If the script execution completed successfully, you will see the following message.
"Secret Configurations are written to the property file successfully" - Now, go back and look at the cipher-text.properties file. The plain text LDAP password will be replaced by a cipher value.
- You will also look at CARBON_HOME/repository/conf/user-mgt.xml where we have specified the connection password for LDAP user.
You will notice that it will be modified by the ciphertool script as follows.
<Property name="ConnectionPassword" svns:secretAlias="UserStoreManager.Property.ConnectionPassword">password</Property> - Now, you can start the server.
e.g:- sh wso2server.sh - This will prompt "[Enter KeyStore and Private Key Password :]" at the server startup because we need to decrypt the encrypted passwords to connect to LDAP.
You can enter "wso2carbon" and the server will be started successfully.
But you will not be able to provide this password value if you start WSO2 Carbon server as a background process.
i.e:- ./wso2server.sh start
In that case, you can follow a simple set of additional steps as explained below - Have a file named "password-tmp" in CARBON_HOME/ directory. Add "wso2carbon" (the primary keystore password) to this file and save
- Now, start the server as a background process.
./wso2server.sh start - Keystore password will be picked up from password-tmp file. Once the server is started, this fill will automatically be deleted from the file system. Make sure to add this temporary file back whenever you start the sever as a background process.
Wednesday, June 5, 2013
Rotating Log Files
This script moves on log files listed on the command line. It keeps all but the most recent onecompressed, and removes the last one once there are more than CYCLES of them. For example,CYCLES=3 ; rotate messages Would have the following effects.messages --> messages.1messages.1 --> messages.2.gzmessages.2.gz --> messages.3.gzmessages.3.gz --> removed
Different RUN levels in Linux,Solaris and AIX
RedHat Linux - Run Levels
0: Halt
1: Single user mode 2: Multiuser, without NFS 3: Full multiuser mode 4: Unused 5: X11 6: Reboot
Solaris - Run Level
S: Single user state (useful for recovery) 0: Access Sun Firmware ( ok> prompt) 1: System administrator mode 2: Multi-user w/o NFS 3: Multi-user with NFS ( default run level) 4: Unused 5: Completely shutdown the
Tuesday, May 28, 2013
Runs previous command replacing the typo
when we run a command with a typo, we can correct the typo and re-run the command by the following command.
^wrong^right
Here are the examples:
The man command is wrongly typed as many
[root@test /]# many head
-bash: many: command not found
The y is replaced with empty character.
[root@test /]# ^y
man head
--------------------------------------------------------------
Here man is typed as
Subscribe to:
Posts (Atom)