Learn linux-By doing the file permissions and file sharing
August 24, 2016
14:21
File permissions and file sharing:
1. Access rights:
Note: For directories, x means that you can search for this directory, so if you do not have permission to execute the directory, you cannot use the LS-L command to list the contents of the directory or use the CD command to change the directory to the current directory.
2. Change the file access permissions:
chmod [Options] Octal-mode file-list
chmod [Options] symbolic-mode file-list ==> chmod u+x file
3. Special Privilege Level:
SUID (Set-user-id) bit: To set the execution bit, when the command executes, the user who is currently launching the command has the same permissions as the execution file owner.
chmod 4xxx File-list
chmod u+s File-list
SGID (Set-group-id) bit: To set the execution file to have the same access rights as the group to which the file belongs
chmod 2xxx File-list
chmod g+s File-list
Sticky bit: It allows the file to be moved or deleted only by its owner or Superuser.
chmod 1xxx File-list
chmod +t File-list
4. Hard link: It is the index node that points to the file, that is, the index node of the directory entry that establishes the hard-linked file with the same file is the same.
Implemented with the LN command, provided that the user who executes the LN command has execute permissions in all directories that are contained in the path name that points to the file.
Hard links can not establish links between files in different file systems.
5. Symbolic Link: The Symbolic link file contains the path information of the source file in the file structure, with a size of 5 bytes.
Implemented with the Ln-s command.
Symbolic links can establish links between files in different file systems. However, the source file path information cannot be changed.
File Permissions and files