Rights Management
Linux permissions:
R: Read
W: Write
X: Execute
-rw-r--r--1 root root
-File (d stands for directory)
3-bit one set
The first 3 bits represent the owner's permission rwx
Intermediate 3-bit delegate permissions for group RWX
The latter 3 bits represent the rights of other users rwx
R 4 W 2 x 1
Default permissions for new files
0664-----Rw-rw-r--.
Maximum privilege is 0666
Default permissions for new directories
0755----drwx-r-xr-x.
Maximum privilege is 0777
Modify Permissions: chmod
Usage: chmod File/directory
Chmod 664 1.txt
[email protected] ~]# ll 1.txt
-rw-r--r--1 root root 0 14:01 1.txt
[Email protected] ~]# chmod 664 1.txt
[email protected] ~]# ll 1.txt
-rw-rw-r--1 root root 0 14:01 1.txt
Chmod u+r 1.txt (-w/x) owner can be added and reduced
Chmod g+r 1.txt (-w/x) group can be added and reduced
Chmod o+r 1.txt (-w/x) other available plus and minus
Modified genera Group: Chown
Usage: chown [owner: Genus] 1.txt
For example:
[email protected] ~]# ll 1.txt
-rw-rw-r--1 root root 0 14:01 1.txt
[Email protected] ~]# Useradd test
[Email protected] ~]# chown test:test 1.txt
[email protected] ~]# ll 1.txt
-rw-rw-r--1 Test test 0 14:01 1.txt
[Email protected] ~]# chown root 1.txt
[email protected] ~]# ll 1.txt
-rw-rw-r--1 root Test 0 14:01 1.txt
[Email protected] ~]# Chown:root 1.txt
[email protected] ~]# ll 1.txt
-rw-rw-r--1 root root 0 14:01 1.txt
linux-Seventh Lesson Notes-[permissions]