User Management (3) - RHCSA

Add Password  to User Account 

 

After we creating a user account we need to assign a password for it because of security. We can assign the password while creating the user account but it is not safe because it will visible for others.
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.
You can use man command to more information.

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.

Comments

Post a Comment

Thank you for your comment

Popular posts from this blog

Add Cisco Layer 2 Switch in GNS3 - GNS3 වලට Cisco Layer2 Switch එකක් ADD කිරීම

Schedule Tasking using "crontab" and "at"

User Management (1) - RHCSA