Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Types of user:
- 1. Root User - It is the super user which can run any command generally used for administration.
- 2. System User - Users needed for system specific operation/components, like mysql user to run mysql.
- 3. Normal User - Other users which are created by root and have limited access given to them.
- ### Atributes:
- 1. User Type: Super user
- 2. User Name: root
- 3. User ID: 0
- 4. Group ID: 0
- 5. Home Directory: /root
- 6. Shell: /bin/bash
- ### Important Files:
- 1. /etc/passwd - Keeps user account and password information.
- 2. /etc/shadow - Keeps the encrypted password of the corresponding account
- ### Creating a User:
- 1. Add a user:
- # usesradd ajeet
- 2. Assign a password:
- # passwd ajeet
- 3. Create user with account expiry date:
- # useradd -e 2018-04-01 xyz
- 4. Create a user with specific user id
- # useradd -u 5111 pqr
- 5. Create a user with specific user id and group id
- # useradd -u 6111 -g 711 foo
- 6. Add user to Multiple groups
- # user add -G dev,qa,prod
- 7. Add user with comments:
- # user add -c”Deverloper” bar
- # tail -1 /etc/passwd
- 8. Add user with home directory
- # user add -d /home/myhome appychip
- # tail -1 /etc/passwd
- ### Deleting a User:
- 1. Deleting existing user:
- # userdel ajeet
- 2. Delete user forcefully, even if the user is logged in
- # userdel -f xyz
- 3. Delete user with home directory
- # user del -r appychip
- ### Modify User Property:
- 1. Changing home directory of a user:
- # usermod -d /home/appychip
- 2. Changing Primary group of a user:
- # usermod -g dev ford
- 3. Lock(-L) and Unlock(-U) users
- # usermod -L pqr
- # usermod -U pqr
- Verify in /etc/shadow if an ! mark is present in front of user name. If present then user is locked.
- After unlock it will disappear
- 4. Changing login name and password
- # usermod -I xyz pqr
- # usermod -p p@ssWord xyz
- 5. View Account raging information:
- # chage -I xyz
- 6. Changing password parameters:
- # chage xyz
- Enter a new value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement