Linux system using additional permissions method

  
                

The Linux system additional permissions mentioned here refer to SET bit permissions and sticky bit permissions. So how do you use these two permissions? This article will introduce you to the use of additional permissions in the Linux system.

SET bit permissions: used to executable program or script file set, which represents an increase SUID bit SET user rights to the owner, SGID SET bit indicates an increase in the rights of a group of users. After the execution file is set with the SUID and SGID permissions, any user who executes the file will obtain the identity corresponding to the file owner and group account.

Adding SET bit permissions to the executable file can also be implemented by the chmod command. The permission modes of u+s and g+s are used to set the SUID and SGID permissions respectively. If digital form is used, SUID corresponds to octal number 4, SGID is 2 for octal number, and can be used in privilege mode, such as "ldl"; , SGID permissions.

Sticky Bit Permissions: It is mainly used to set special additional permissions for the directory. When the directory is set with sticky bit permissions, even if the user has write permission to the directory, the other contents in the directory cannot be deleted. User's file data. A directory with sticky bit permissions is set. When ls is used to view its properties, the x at other user permissions will become t.

When using the chmod command to set directory permissions, the +t, -t permission modes can be used to add and remove sticky bit permissions. Adding and removing sticky bit permissions can also be done by changing the first digit in the numeric permission mode nnnn to 1, 0.

Privilege: suid sgid

[root@ocm1 ~]# vim kuqlan.sh

[root@ocm1 ~]# ll

total 84

-rw-r--r-- 1 root root 17 Mar 10 12:57 kuqlan.sh

lrwxrwxrwx 1 root root 3 Mar 9 16:58 t.link -》 ttt< Br>

[root@ocm1 ~]# chmod 755 kuqlan.sh

[root@ocm1 ~]# ls -al kuqlan.sh

-rwxr-xr-x 1 root Root 17 Mar 10 12:57 kuqlan.sh

[root@ocm1 ~]# chmod 4755 kuqlan.sh

[root@ocm1 ~]# ls -al kuqlan.sh

-rwsr-xr-x 1 root root 17 Mar 10 12:57 kuqlan.sh

[root@ocm1 ~]# chmod 2755 kuqlan.sh

[root@ocm1 ~ ]# ls -al kuqlan.sh

-rwxr-sr-x 1 root root 17 Mar 10 12:57 kuqlan.sh

[root@ocm1 ~]# chmod 6755 kuqlan.sh

[root@ocm1 ~]# ls -al kuqlan.sh

-rwsr-sr-x 1 root root 17 Mar 10 12:57 kuqlan.sh

Linux How the system uses additional permissions to introduce you here ,I hope to be helpful.

Copyright © Windows knowledge All Rights Reserved