Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux's method of modifying the group to which a user belongs

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Linux modifies the group to which the user belongs

1. Set the group to which a user belongs

Usermod-g user group username

Note:-g |-- gid. Modify the user's gid. This group must exist.

2. Add users to a group (s)

Usermod-a-G user group username

Note:

-a |-- append to append users to certain groups, using only with the-G option

-G |-- groups, append users to certain groups, and use only with the-an option

Content expansion

User management command

Useradd Note: add user

Adduser Note: add user

Passwd Note: set the password for the user

Usermod Note: modify user commands, you can use usermod to modify login, user's home directory, and so on.

Pwcov Note: synchronize users from / etc/passwd to / etc/shadow

Pwck Note: pwck verifies whether the contents of the user profile / etc/passwd and / etc/shadow files are legal or complete

Pwunconv Note: it is a vertical reverse operation of pwcov, which creates / etc/passwd from / etc/shadow and / etc/passwd, and then deletes the / etc/shadow file

Finger Note: view user Information tool

Id Note: check the user's UID, GID and the user group to which they belong

Chfn Note: change user Information tool

Su Note: user switching tool

Sudo Note: sudo executes commands (execute a command as another user) through another user, su is used to switch users, and then completes the corresponding tasks by switching to users, but sudo can directly execute commands later, for example, sudo does not need root password to execute root assigned execution, only root can execute corresponding commands; but it has to be edited / etc/sudoers through visudo.

Visudo Note: visodo is the command for editing / etc/sudoers; you can also use vi to edit / etc/sudoers directly without this command.

Sudoedit Note: similar to sudo function

These are all the contents of this introduction. Thank you for your study and support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 303

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report