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

Example of user group and rights management in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly shows you the "user groups and rights management in linux operation examples", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "user groups and rights management in linux operation examples" this article.

Experimental purpose:

Proficient in useradd, groupadd, chown, chmod commands to add and delete users, add and delete groups, set permissions for users and groups, modify the ownership of users, etc., and make use of passwd, su commands. Familiar with the functions and methods of special permissions suid, sgid, sticky, acl.

Experimental procedure

Learn about the parameters used by the useradd command to add users, such as-g sets the primary group,-G sets the basic group, and the default shell,-M of-s does not create a home directory, and so on. Be familiar with the meaning of applying rwx permissions to files and directories, and octal numbers represent permissions. Understand when you need to set special permissions suid, sgid, sticky, acl.

1. Useradd command: add subscribers to the system

2.] add "apache" to the system. The default shell is / sbin/nolgoin and no home directory is created.

S

-M

3. Add develop group

4. Set / home/app/run/apache record and its master group as apache

5. Modify permissions to add write and permission to the owner, group does not have read permission, others have read and permission.

6. Recursively set the testdir login permissions as follows: add read, writeable and executable permissions to the group, but do not add license permissions to the users.

7. Set the 1.sh permission to read and write only to the owner.

8. Modify the login password of the subscriber linux

9. Completely switch between linux customers and customers

Su-root

10. Not completely switch to linux account

Su

11. Set "binary executable program" chmod has suid permission

Chmod 4755

12. Cancel the suid permission owned by the chmod of the binary executable program

13. Set "binary executable program" chmod has sgid permission

14. Cancel the sgid permission owned by the chmod of the binary executable program.

15. Set sgid permissions to the testdir directory as a collaborative directory

16. Cancel the sgid permission of testdir directory

17. Set the sticky permission on the testdir record, so that only the owner or root of the license can delete the copy recorded by the license.

Chmod Onegt or chmod 1777

18. Revoke the sticky permission of testdir subscription

19. The new tools created in / testdir/dir tools belong to group G1. Members of group G2, such as alice, can read and write to these new pieces. Members of group G3, such as tom, can only have read access to new pieces, and other users (which do not belong to g1Jie G2G3) cannot access this folder.

6. User groups and Rights Management-Lab Manual

20. Back up the ACL permissions of "all" parts of / testdir/dir to / root/acl.txt, clear all ACL permissions in / testdir/dir, and finally restore ACL permissions.

These are all the contents of this article entitled "examples of user groups and Rights Management in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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