GagA// 0n D nEt

It is currently Sun Feb 25, 2018 12:04 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Linux: Delete user password / Disable user account
PostPosted: Wed Mar 25, 2009 10:01 am 
Offline

Joined: Wed Jul 18, 2007 1:14 am
Posts: 181
You can use the command line utility to delete the password for a user or suspend the access for the user or disable the user in linux.

All the user passwords are stored in /etc/shadow file. It is not recommended to modify this file manually. The best option is to use the passwd command.

The following are the various methods to achieve this:

Command to delete user password / disable user access in linux

You can use the following command to delete the password for a user from the shadow file:
Quote:
[[email protected] ~]# passwd --delete tom

Or
Quote:
[[email protected] ~]# passwd -d tom

The above command will delete the password for tom and will empty out the password field in the /etc/shadow file. It will set the account without any password, hence the user won't be able to login.

The other option is to set a nologin user shell for a user in order to disable the access for a user. So the following can be another option to disable the access:
Quote:
[[email protected] ~]# usermod -s /sbin/nologin tom

The above command will render the user tom without any login shell.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group