Default Permissions
Each terminal has a Umask attribute to determine the default permissions for new files and folders
Umask is represented by the use of digital permissions, such as 022
The default permissions for the directory are: 777-umask
The default permissions for files are: 666-umask
Generally, the default umask for ordinary users is the default for 002,root users umask is 022
In other words, for ordinary users:
The permissions for the new file are: 666-002 = 664
The permissions for the new directory are: 777-002 = 775
Command umask to view setting umask values
$ umask View the current umask value. (see there are 4, said later)
$ umask 022 puts the current umask value at even 022
Special permissions
In addition to normal permissions, there are special permissions
With the command umask, you will see that there are 4, each accounted for 3bit, so Linux permissions binary total 12 bits, Ugo accounted for the latter 9 digits, the beginning of 3 bits are special permissions.
For example:
$ ls-l/USR/BIN/PASSWD
Show:
-rwsr-xr-x 1 root root 41284 Apr 9 2012/usr/bin/passwd
The x bit of the U permission turns to S, stating that this file is suid permission
Set special Permissions
Set Suid: $ chmod u+s test
Set Sgid: $ chmod g+s test
Set Sticky: $ chmod o+t test
As with normal permissions, special permissions can also be represented in a digital way
-suid = 4
-sgid = 2
-sticky = 1
So, we can set the following command:
$ chmod 4755 Test
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/