Friday, May 6, 2011

For locking a account and unllocking

For Locking the account you can use

passwd -l {username}

For unlocking the account you can use

passwd -u {username}

Once the account is locked no person can login to the user via the locked account.

The change can be noticed in /etc/shadow's fie for the locked account.

The account can  be locked only by the superuser or any user with that  privelage.

For adding a role to a user account

You can use the command

usermod -R adminsecurity  anand

here anand is a user
and adminsecurity is the role added to the user anand

For adding the role to the user,you must be a super user(ROOT).





port 22 connection refused

if this errors while trying ssh
Check sshd daemon is running in the server machine

you can check this by logging into the server machine and trying

ps -ef | grep sshd


if you find the ssh daemon process you check port 22 is used by some other process 


netstat -tupn
or  
chkconfg --list sshd