Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. ### Types of user:
  2.  
  3. 1. Root User - It is the super user which can run any command generally used for administration.
  4. 2. System User - Users needed for system specific operation/components, like mysql user to run mysql.
  5. 3. Normal User - Other users which are created by root and have limited access given to them.
  6.  
  7. ### Atributes:
  8.  
  9. 1. User Type: Super user
  10. 2. User Name: root
  11. 3. User ID: 0
  12. 4. Group ID: 0
  13. 5. Home Directory: /root
  14. 6. Shell: /bin/bash
  15.  
  16. ### Important Files:
  17.  
  18. 1. /etc/passwd - Keeps user account and password information.
  19. 2. /etc/shadow - Keeps the encrypted password of the corresponding account
  20.  
  21. ### Creating a User:
  22.  
  23. 1. Add a user:
  24. # usesradd ajeet
  25. 2. Assign a password:
  26. # passwd ajeet
  27. 3. Create user with account expiry date:
  28. # useradd -e 2018-04-01 xyz
  29. 4. Create a user with specific user id
  30. # useradd -u 5111 pqr
  31. 5. Create a user with specific user id and group id
  32. # useradd -u 6111 -g 711 foo
  33. 6. Add user to Multiple groups
  34. # user add -G dev,qa,prod
  35. 7. Add user with comments:
  36. # user add -c”Deverloper” bar
  37. # tail -1 /etc/passwd
  38. 8. Add user with home directory
  39. # user add -d /home/myhome appychip
  40. # tail -1 /etc/passwd
  41.  
  42. ### Deleting a User:
  43.  
  44. 1. Deleting existing user:
  45. # userdel ajeet
  46. 2. Delete user forcefully, even if the user is logged in
  47. # userdel -f xyz
  48. 3. Delete user with home directory
  49. # user del -r appychip
  50.  
  51. ### Modify User Property:
  52.  
  53. 1. Changing home directory of a user:
  54. # usermod -d /home/appychip
  55. 2. Changing Primary group of a user:
  56. # usermod -g dev ford
  57. 3. Lock(-L) and Unlock(-U) users
  58. # usermod -L pqr
  59. # usermod -U pqr
  60. Verify in /etc/shadow if an ! mark is present in front of user name. If present then user is locked.
  61. After unlock it will disappear
  62. 4. Changing login name and password
  63. # usermod -I xyz pqr
  64. # usermod -p p@ssWord xyz
  65. 5. View Account raging information:
  66. # chage -I xyz
  67. 6. Changing password parameters:
  68. # chage xyz
  69. Enter a new value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement