Sunday, December 15, 2013

Linux Set or Change User Password

Task: Set or Change User Password

Type passwd command as follows to change your own password:
$ passwd
Output:
Changing password for vivek
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
The user is first prompted for his/her old password, if one is present. This password is then encrypted and compared against the stored password. The user has only one chance to enter the correct password. The super user is permitted to bypass this step so that forgotten passwords may be changed.
A new password is tested for complexity. As a general guideline, passwords should consist of 6 to 8 characters including one or more from each of following sets:
  1. Lower case alphabetics
  2. Upper case alphabetics
  3. Digits 0 thru 9
  4. Punctuation marks

Task: Change Password For Other User Account

You must login as root user, type the following command to change password for user vivek:
# passwd vivek
Output:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Where,
  • vivek - is username or account name.

Task: Change Group Password

When the -g option is used, the password for the named group is changed. In this example, change password for group sales:
# passwd -g sales
The current group password is not prompted for. The -r option is used with the -g option to remove the current password from the named group. This allows group access to all members. The -R option is used with the -g option to restrict the named group for all users.

1 comment:

  1. This is a great article and I found lot of valuable information from here.

    You would love to check this article that has great information.

    https://techiewheel.blogspot.com/2021/01/how-to-change-password-in-linux.html

    ReplyDelete