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

How to modify user permissions in linux

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces how to modify user rights in linux. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Modify permissions:

1) tools or commands for managing users (user)

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: the function is similar to sudo.

If you modify the user's own permissions, there is not much to change, after the average user creates a user (useradd), the user will have a default or specified userid and groupid. Generally speaking, files under UNIX system are divided into three categories: "user itself, usergroup, and other user", which can be "read, write and execute". You can see them with ls-la, such as:

# ls-l

-rwxr-xr-x 1 root bin 62528 Jan 23 2005 zip

Where r means it can be read by read/, w means it can be written by write/, and x means it can be executed by execute/.

Userid is generally unique, but you can modify the group information of your user to join the user group you need to access specific files.

Groupadd: add user group

Groupdel: delete user group

Groupmod: modifying user group information

2) tools or commands for managing user groups (group)

Groupadd Note: add a user group

Groupdel note: delete a user group

Groupmod Note: modify user group information

Groups note: displays the user group to which the user belongs

Grpck

Grpconv Note: synchronize or create / etc/gshadow through the file contents of / etc/group and / etc/gshadow, or create / etc/gshadow if / etc/gshadow does not exist

Grpunconv note: synchronize or create / etc/group with the contents of the / etc/group and / etc/gshadow files, and then delete the gshadow file.

On how to modify user rights in linux to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

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: 0

*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