Friday, 7 October 2011

Command to delete user password under Linux

Type the following command to delete a user password:
# passwd --delete username
# passwd -d username
Above command delete a user's password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless. User will not able to login.
It is also a good idea to setup user shell to nologin to avoid security related problems:
# usrmod -s /sbin/nologin username
For example to delete password for user johnc, Type:
# passwd -d johnc
# usrmod -s /sbin/nologin johnc

No comments:

Post a Comment

How can VMware Integrated Containers be useful in real life scenario

What is VIC: VIC - vSphere Integrated Containers enables IT, teams, to seamlessly run traditional workloads and container workloads ...