Linux Fundamentals - special privileges

Special permissions
SUID SGID Sticky

SUID: mainly used to manage files when a file has SUID, any user rwx in the implementation of operations on the file to see that the owner of the file may not have rwx permission, nothing to do with the other.
     For example:
         the permissions of a file to rwx ------ root: root / tmp / test
          when other users (non-root) when performing a read operation, cat / tmp / test, you will be prompted authority is not sufficient to execute
         permissions of a file as rws ------ root: root / tmp / test
         when other users (non-root) to perform a read operation, cat / tmp / test, the successful implementation of
         a prompt: execute permissions on the owner's position in the display, if the original there are x, is displayed as lowercase s, otherwise uppercase S
         chmod U + | - S FILE
                    
SGID: after mainly used to manage the directory, when a directory with write access, and there is SGID, the user as long as belonging to the group that in the directory when creating a new file, it is a group is a group of files to a directory, the non-primary user group.
     For example:
         permissions for a directory rwxrwx --- user1: user3 / tmp / test
         When a user (user2, user2 main group, an additional group USER3) when creating a file in this directory, the resulting file is a group of user2
         a directory permissions to rwxrws --- user1: user3 / tmp / test
         When a user (user2, the main group user2, an additional group user3) to create a file in this directory, the resulting file is a group of user3                               
         when a file is a group of different user-created are the same, so different users for all documents Edit or delete permissions
         prompts: displayed on the execution permission bits belong to the group, if the original has x, is displayed as lowercase s, otherwise uppercase S
         chmod G + | -s FILE
                                
Sticky: general and SGID used together, when a after the directory has Sticky, file different user-created, other users not authorized to delete                               
         a prompt: displayed on the execution permission bits of other people, if the original has x, is displayed as a lowercase t, otherwise uppercase T                               
         chmod O + | -t fILE
                                        
Note: the main usage rights of SGID and Sticky similar to code management, different users can create and modify their own files, but other people can not move files   

Permissions can also be modified for use octal notation, such as chmod 1777 / tmp / file

                                                 

SOUTH

SGID

STICKY

Octal representation

0

0

0

0

0

0

1

1

0

1

0

2

0

1

1

3

1

0

0

4

1

0

1

5

1

1

0

6

1

1

1

7

Guess you like

Origin www.cnblogs.com/super2279/p/11490914.html