User Management (3) - RHCSA
Add Password to User Account
So that we use passwd command for assigning passwords.
After executing this command following will appear.
So when we type in New password section, text wont be displayed. So that's why we assign password after creating a user. Than you have to re-enter the password.
After assigning the password we can verify it using cat /etc/shadow | grep <user name>
After executing this following information will retrieve.
If you get second type <user name>:!!: --------- it means No password.
If you get first type it means successfully added and encrypted the password. There are some information to grab.
- $6$ means used hashing algorithm was sha512
- 95JL... value is known as salt value.
Retrieving Information and update password and user account aging information
In some cases password should be expired , account should be expired, there should be password expiring warning date before expire it etc. So we can retrieve these information by using chage command.<user name> should be changed. -l is for retrieving user account aging information.
After that you will get following information.
So we can edit it using chage <user name> .
After that line after line will be prompted. So you can give relevant information for it. if you do not want to change the current line just press ENTER key.
Modify User
After creating a user , we can modify that user. We use usermod command for that.
There are options as well.
- -c used to add comment. Typically used to add users' full name.
- -e used to user account expire date. Format should be YYYY-MM-DD
- -G used to add users to groups.
- -g used to assign a group id.
- -s used to define users login shell.
- -u used to assign user id.
usermod -c PaulSmith paul ----> set pauls' full name as Paul Smith.
usermod -e 2020-05-20 paul ---> pauls' account will be disabled in 2020 may 20.
So you can modify your user.
User Account part is officially over 😂. Next sections will be Groups, file permissions, Special permissions, ACL, Disk Management, schedule tasking etc.
Nice article ! Keep it up!
ReplyDelete