Thursday, 19 July 2012

How to create virtual user in ftp using "pure-pw" command

How to create virtual user for existing ftp share using "pure-pw" command

1. Login to the FTP Server
2. Execute the below command

#pure-pw useradd <username> -u ftpuser -d /ftpfolder/cssbt -N 1024

provide the password when prompted

3. Execute the below command to save the configuration

#pure-pw mkdb

Friday, 20 April 2012

How to create ldap user in Linux LDAP Server

Lets see how to create ldap user in Linux LDAP Server

Step 1: Create a local user account named <sl092467> in LDAP Server

#useradd sl092467

Step 2 : Note down the details of the user using passwd file

#cat /etc/passwd | grep sl092467               (note down uid, gid etc)

Step 3 : create a file named <raja> and enter as below

dn: uid=sl092467,ou=People,dc=csscorp,dc=com
uid: sl092467
cn: sl092467
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$QLoEkVTC$RHrUQKYbqtRi4cfoPtusT.
shadowLastChange: 15027
shadowMin: 1
shadowMax: 90
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1014
gidNumber: 1014
homeDirectory: /home/sl092467

Step 4 : Save the file and execute the below command to add user sl092467 as ldap user

#ldapadd  -D "cn=Manager,dc=csscorp,dc=com"  -W -x  -f /home/venkat/ldap/raja

Step 5 : execute the below command to set ldap password for user sl092467

#ldappasswd -S -x -W -D "cn=Manager,dc=example,dc=com" "uid=sl092467,ou=People,dc=example,dc=com"

Enter ldap password for user and confirm the password. Then u will be prompted for ldap root password

Step 6 :  To add user sl092467 as a member of sladmin group. Open the <groupname>.ldif file

dn: cn=sladmin,ou=Group,dc=csscorp,dc=com
objectClass: posixGroup
objectClass: top
cn: sladmin
userPassword: {crypt}x
gidNumber: 1050
memberUid: sl000132
memberUid: sl005204
memberUid: sl005207
memberUid: sl005209
memberUid: sl005241
memberUid: sl005262
memberUid: sl007290
memberUid: sl088966
memberUid: sl089004
memberUid: sl005408
memberUid: css95891
memberUid: sl092467
memberUid: sl088735
memberUid: sl005539
memberUid: css05210

Step 7 : Add the user sl092467 as highlighted above and save the file

Step 8 : Execute the below command to add user sl092467 as member of sladmin group

#ldapmodify  -D "cn=Manager,dc=csscorp,dc=com"  -W -x  -f grp_modi.ldif

Step 9 : Login to linux server using ldap account credentials. when u login for the first time u will be prompted to change the password.







Thursday, 12 April 2012

How to Setup NFS in Linux Server

How to Setup NFS Server

Step 1: Install the following nfs packages in linux server
  •    nfs-utils
  •    libevent
# rpm -ivh nfs-utils-1.0.9-60.el5.x86_64.rpm libevent-1.4.13-1.x86_64.rpm

Step 2: Start the nfs and portmap service as mentioned below

# /etc/init.d/nfs start
# /etc/init.d/portmap restart

Step 3: Open the nfs file /etc/exports and enter details as below

# vim /etc/exports

/data   10.2.1.x(rw,no_root_squash) 10.2.1.x(rw,no_root_squash)

Step 4: Save the file and restart portmap and nfs service

How to Setup NFS Client:

Step 1: Login the server where u want to mount the nfs partition and start netfs and portmap service

# /etc/init.d/netfs start
# /etc/init.d/portmap start

Step 2: Open the fstab file and make an entry as below

# vim /etc/fstab
10.2.1.x:/data/dbbackup     /nfs          nfs               defaults               0 0

Step 3:  Save the file and restart netfs service

Step 4: execute mount command to mount the nfs partition

# mount -a

Step 5:  check whether the nfs partition is mounted using the below command

#df -h


http://www.cyberciti.biz/faq/centos-fedora-rhel-nfs-v4-configuration/


Tuesday, 10 April 2012

How to enable remote access to mysql database

Recently in one of the server mysql was running but in netstat output port was not listening due to which users are not able to connect database in the server.

But able to login to mysql prompt without any issues

Resolution:

Step 1: Login to the server using putty
Step 2: Edit my.cnf file

  • If you are using Debian Linux file is located at /etc/mysql/my.cnf location
  • If you are using Red Hat Linux/Fedora/Centos Linux file is located at /etc/my.cnf location
  • If you are using FreeBSD you need to create a file /var/db/mysql/my.cnf
#vi /etc/my.cnf

Step 3:  Make sure line skip-networking is commented (or remove line) and add following line

bind-address=YOUR-SERVER-IP
 
  • bind-address : IP address to bind to.
  • skip-networking : Don’t listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. Since you need to allow remote connection this line should be removed from my.cnf or put it in comment state.
Step 4: restart mysql service and check accessing remotely. 
 

Monday, 5 March 2012

Avoid Password Prompt When Executing The Sudo Command

If local user want to execute a command using sudo and does not want the password prompt then

1. Create a user
2. open the sudoers file 

enter as follows

rajasekar ALL=(ALL)       NOPASSWD: NOPASSWD: ALL


Friday, 24 February 2012

Jboss Installation Steps in Linux

1. wget http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1.0.Final.zip
2. unzip jboss-as-distribution-6.1.0.Final.zip
3. cd /usr/local
4. mv jboss-6.1.0 .
5. ln -s /usr/local/jboss-6.1.0 jboss
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u30-download-1377139.html.
6.  chmod +x jdk-6u30-linux-i586.bin
7. ./jdk-6u30-linux-i586.bin
8. mv jdk1.6.0_30/ /usr/lib/
9. cd /usr/lib
10. ln -s jdk1.6.0_30/ jdk
11. JAVA_HOME="/usr/lib/jdk"
12. echo $JAVA_HOME
13. PATH=$JAVA_HOME/bin:$PATH
14. echo $PATH
15. cd /usr/local/jboss-6.1.0.Final/bin/
16. ./run.sh -b 0.0.0.0 &
17. ps -ef | grep jboss


How to Set JAVA_HOME / PATH variables Under Linux Bash Profile

Set JAVA_HOME / PATH for single user

Login to your account and open .bash_profile file
$ vi ~/.bash_profile
Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-java>. If your path is set to /usr/java/jdk1.5.0_07/bin/java, set it as follows:
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java
Set PATH as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
Save and close the file. Just logout and login back to see new changes:
$ echo $JAVA_HOME
$ echo $PATH

Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:
$ which java

 

Set JAVA_HOME / PATH for all user

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# vi /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

 

 

 

Tuesday, 31 January 2012

How to add users / change password for phpmyadmin console

config.inc.php file under phpmyadmin will have configuration details about phpmyadmin console


EX: /var/www/html/iris/phpmyadmin/config.inc.php


Default username and password is root 

http://www.phpmyadmin.net/documentation/