≡ Menu

encrypted passwords

Linux / UNIX: Generating Random Password With mkpasswd / makepasswd / pwgen

How do I generate random password to use with my shell script? How to create random password on Linux or Unix command line?
[click to continue…]

Linux: Delete user password

Q. How do I delete user Password under Linux? I’d like to disable a password for an account.

A. All user encrypted passwords are stored in /etc/shadow file. The quick way to remove/delete a user password is pass –delete option to passwd command. First, login in as a root user.

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 usernameFor example to delete password for user sweta, Type:# passwd -d sweta
# usrmod -s /sbin/nologin sweta

See also: