Professional Documents
Culture Documents
Changing Permissions With Numbers: Red Hat Linux 7.2: The O Cial Red Hat Linux Getting Started Guide
Changing Permissions With Numbers: Red Hat Linux 7.2: The O Cial Red Hat Linux Getting Started Guide
Red Hat Linux 7.2: The Official Red Hat Linux Getting Started Guide
Prev Chapter 10. Shell Prompt Basics Next
r=4
w=2
x=1
-=0
When these values are added together, the total is used to set specific permissions.
The total for the user is six, the total for the group is six and the total for others is
four. The permissions setting, then, is read as 664.
If you want to change sneakers.txt so those in your group will not have write access,
but can still read the file (as shown in Figure 10-16), remove the access by
subtracting 2 from that set of numbers.
The numerical values, then, would become six, four, and four — or 644.
So type:
1 de 3 22-11-2013 21:45
Changing Permissions With Numbers http://www.centos.org/docs/2/rhl-gsg-en-7.2/s1-navigatin...
Now, neither the group nor others have write permission to sneakers.txt. To return the
group's write access for the file, add the value of w (2) to the second set of
permissions.
Here is a list of some common settings, numerical values and their meanings:
-rw------- (600) — Only the owner has read and write permissions.
-rw-r--r-- (644) — Only the owner has read and write permissions; the group and
others can read only.
-rwx------ (700) — Only the owner has read, write and execute permissions.
(755) — The owner has read, write and execute permissions; the group
-rwxr-xr-x
and others can only read and execute.
(711) — The owner has read, write and execute permissions; the group
-rwx--x--x
and others can only execute.
(666) — Everyone can read and write to the file. (Be careful with these
-rw-rw-rw-
permissions.)
-rwxrwxrwx(777) — Everyone can read, write and execute. (Again, this permissions
setting can be hazardous.)
drwx------ (700) — Only the user can read, write in this directory.
(755) — Everyone can read the directory, but its contents can only be
drwxr-xr-x
changed by the user.
2 de 3 22-11-2013 21:45
Changing Permissions With Numbers http://www.centos.org/docs/2/rhl-gsg-en-7.2/s1-navigatin...
3 de 3 22-11-2013 21:45