Linux - Password (User)

About

user password are password of a user stored in the secure shadow file.

Special value

The password is the second field of the shadow file

It's 13 character encrypted

  • A blank entry (eg. ::) indicates a password is not required to log in
  • A * indicates the account has been disabled.
  • !! or ! : no password has been given (the account is locked)

Management

Set

To set/change a password, use the passwd command

Options:

  • user's name (Only required if you are root and want to change another user's password)

Example

Change the password for the account you are currently logged in

 passwd
Changing password for user gerardnico.
Changing password for gerardnico
(current) UNIX password:
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Change the password for a user

To change the password for the user 'gerardnico' (only if you are logged in as root)…

passwd gerardnico
Changing password for user gerardnico.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.





Discover More
Linux - /etc/shadow (Secure user information)

/etc/shadow is a text file that contains secure user information such as: password. and account expiration information The public user information are stored in the /etc/passwd file. The shadow...
Linux - User (Uid)

Every user who has access to a Linux system needs a login and a password. The root login is the super admin user. The term root may refer to: the root account (the superuser, who has permission...



Share this page:
Follow us:
Task Runner