|
Very important! Relations between the authority and command:
We know that Linux permissions for the user account is very important, because he can limit users can read / create / delete / modify a file or directory! In this chapter we introduce a lot of file system management commands, the sixth chapter describes the meaning of a lot of file permissions. In this section of them, we will combine the two, explain what order and under what authority will be able to run it!
First, allowing users to enter a directory as the basic permissions why "can work list":
You can use the command: A transformation such as the command cd working directory;
Directory permissions required: Users need to have at least the directory permissions of x
Additional requirements: If a user wants to use ls to view the file name in this directory, this directory users also need r permission.
Second, the basic user permissions to read why a file in a directory?
Command can be used: for example, discussed in this chapter cat, more, less, etc.
The required directory permissions: users of this directory will need at least x authority;
The required file permissions: Users need to have at least file permission r for the job!
Third, the basic permissions so that users can modify a document why?
You can use the command: For example nano vi editor or the like to introduce the future;
The required directory permissions: users in the directory where the file must be at least x authority;
The required file permissions: users of the file must have at least r, w permission
4, so that a user can create a basic file permissions Why?
Directory permissions required: users in the directory to have w, x permissions, focusing in w it!
Fifth, allow the user to enter a directory and run the command of the basic rights to a directory that?
Directory permissions required: The user must have at least x directory permissions;
File permissions required: user files in the least need permission of x
Example:
So that a user can be vbird "cp / dir1 / file1 / dir2" command, please specify the minimum required permissions dir1, file1, dir2 Why?
answer:
When you run the cp, vbird to "be able to read the source file and written to the destination file! "So should the second reference point and the fourth point instructions! Therefore, the minimum permissions for each file / directory should be: dir1: at least need to have x permission;
file1: need at least r privilege;
dir2: need at least w, x permissions.
Example:
There is a file full name /home/student/www/index.html, the relevant authority file / directory is as follows: drwxr-xr-x 23 root root 4096 Sep 22 12:09 /
drwxr-xr-x 6 root root 4096 Sep 29 02:21 / home
drwx ------ 6 student student 4096 Sep 29 02:23 / home / student
drwxr-xr-x 6 student student 4096 Sep 29 02:24 / home / student / www
-rwxr - r-- 6 student student 369 Sep 29 02:27 /home/student/www/index.html
Will vbird this account (not a student group) can read the index.html this document?
answer:
Although the www and index.html is vbird allows permissions to read, but because the root of the directory structure is read layer by layer, so vbird enter / home but can not enter / home / student /, since even enter / home / student are not allowed, of course, can not attend the index.html! So the answer is' vbird not read the content of index.html "Oh!
To modify how that power? In fact, as long as the / home / student permission to modify the minimum 711, or 755 can be administered directly to the Luo! This is a very important concept Oh! |
|
|
|