Passwd

From LQWiki
Jump to navigation Jump to search

passwd is the command for changing a user's password, or is the name for the global password file, /etc/passwd.

To change the password for the current user account, invoke passwd with no arguments - that is, simply type passwd at the command prompt and press 'enter'. Then enter the new password twice (for verification) at the prompts.

A poor password should result in a warning, such as 'too short' or 'not enough different characters' or even 'based on a dictionary word'. On many systems passwd will still change the password as long as the warning is overridden, which is not secure. Try to heed the warnings passwd may issue you.

Of course, normal users cannot change other people's passwords, but users can change their own passwords by typing passwd. Root can change any user's password. Here is an example of root changing the password for the "bob" account:

# passwd bob
(verbose advisory message)
New password:
Re-enter new password:
Password changed.
#

The password file /etc/passwd can be edited directly if need be, and the superuser can do this by editing the file with vipw.

See also