Linux extended Rights default permissions and special permissions for Linux create a file: Touch filename1
To view the default permissions for a new file: Ls-l filename1
-rw-rw-r--1 Liu Liu 0 June 7 09:33 file1
Create a folder: mkdir filename2
View the default permissions for a new folder L:ls-ld filename2
Drwxrwxr-x 2 Liu Liu 4096 June 7 09:34 file2
found that by default, folders are more than files with an X permission, or you cannot view folders, and each file folder has a default permission.
Default Permissions
each terminal has a Umask property to determine the default permissions for new files and folders
Umask uses digital-digital permissions to represent, for example: 022
The default permissions for the directory are: 777-umask
The default permissions for files are: 666-umask(no x permission, default cannot be performed)
In general, the default umask for normal users is the default umask for 002,root users is 022.
In other words, for ordinary users to
The default permissions for the normal directory are: 775 that is drwxrwxr-x
The default permissions for normal files are: 664 that is-rw-rw-r--
Command Umask to modify default permissions
Umask numbers (e.g. 022)
As a matter of fact
the umask shows 4 bits, the latter three is Ugo, and the first is the one used to save special permissions.。
Special permissions In addition to normal permissions, there are three special permissions:
impact of permissions on files on the directory
SUID executes as the file's owning user without
, not the user who executed the file
Sgid the owning group of any new files created in this directory as the group of which the file belongs
Same as the owning group for this directory
Sticky users who do not have write access to the directory can only delete
The files it owns cannot be deleted by other users
Some files
Set special permission settings Suid:chmod u+s filename
Set Sgid:chmod g+s filename
Set Sticky:chmod a+t filename
As with normal permissions, special permissions can also be represented by numbers:
-suid = 4
-sgid = 2
-sticky = 1
We can use the following command to set up
chmod 4775 filename
Linux Getting Started Foundation--linux extended permissions