当前位置:网站首页>User management and permissions

User management and permissions

2022-06-25 18:36:00 ookaoooo

  1、Linux View all users in the

  (1) In the terminal . Actually, just look at /etc/passwd Just a file .

  (2) Look at the third parameter :500 The above , It's the user who built it later . Others are users of the system .

   Or use cat /etc/passwd |cut -f 1 -d :

  2、 User management command

  useradd notes : Add users

  adduser notes : Add users

       userdel notes : Delete account

  passwd notes : Set the password for the user

  usermod notes : Modify user command , Can pass usermod To modify the login name 、 User's home directory, etc ;

  pwcov notes : Synchronize users from /etc/passwd To /etc/shadow

  pwck notes :pwck Is to verify the user profile /etc/passwd and /etc/shadow Whether the content of the document is legal or complete ;

  pwunconv notes : yes pwcov The reverse operation of the system , It's from /etc/shadow and /etc/passwd establish /etc/passwd , It is then deleted /etc/shadow file ;

  finger notes : View user information tool

  id notes : Check the user's UID、GID And the user group to which they belong

  chfn notes : Change user information tool

  su notes : User switching tool

  sudo notes :sudo It's through another user to execute the command (execute a command as another user),su It's used to switch users , Then complete the corresponding task by switching to the user , but sudo It can execute commands directly from behind , such as sudo Unwanted root The password can be executed root The implementation of bestowal is only root To execute the corresponding command ; But it has to pass visudo To edit /etc/sudoers To achieve ;

  visudo notes :visodo It's the editor /etc/sudoers The order of ; You don't have to use this command , Direct use vi To edit /etc/sudoers The effect is the same ;

  sudoedit notes : and sudo It's almost functional ;

  3、 Manage user groups (group) A tool or command of ;

  groupadd notes : Add user group ;

  groupdel notes : Delete user group ;

  groupmod notes : Modify user group information

  groups notes : Displays the user group to which the user belongs

  grpck

  grpconv notes : adopt /etc/group and /etc/gshadow To synchronize or create /etc/gshadow , If /etc/gshadow Create if it does not exist ;

  grpunconv notes : adopt /etc/group and /etc/gshadow File content to synchronize or create /etc/group , Then delete gshadow file

原网站

版权声明
本文为[ookaoooo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190529471922.html