Difference between revisions of "Permissions"

From John Freier
Jump to: navigation, search
(Read/Write/Execute)
(Read/Write/Execute)
 
(10 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
restorecon -R -v
 
restorecon -R -v
  
----
+
 
 
== Read/Write/Execute ==
 
== Read/Write/Execute ==
<code>
+
                4              2              1
        4              2              1
+
              Read            Write          Execute
        Read            Write          Execute
+
         0 No No No
         0       No             No             No
+
        1 No No Yes
 +
        2 No Yes No
 +
        3 No Yes Yes
 +
        4 Yes No No
 +
        5 Yes No Yes
 +
        6 Yes Yes No
 +
        7 Yes Yes Yes
 +
 
 +
Examples
 +
 
 +
    drw-r--r-- = (4+2+1)(4)(4) = 744
 +
   
 +
    User = (read/write)
 +
    Group = (read)
 +
    Other = (read)
 +
 
 +
Set all the members(user, group, other) for a file to Read & Write
 +
  chmod a=rw example.data
 +
 
 +
Set the User to Read, Write, & Execute
 +
  chmod u=rwx example.data
  
1 No No Yes
+
Add the Write permission to the Group for a file.
2 No Yes No
+
  chmod g+w example.data
3 No Yes Yes
+
4 Yes No No
+
5 Yes No Yes
+
6 Yes Yes No
+
7 Yes Yes Yes
+
  
</code>
+
Remove the Read & Write from the Other membership of a file.
<math>y =y + 12</math>
+
  chmod o-rw example.data

Latest revision as of 13:40, 1 November 2021

Fix permissions

restorecon -R -v


Read/Write/Execute

               4               2               1
              Read            Write           Execute
       0 	No 	 	No 	 	No
       1 	No 		No 		Yes
       2 	No 		Yes 		No
       3 	No 		Yes 		Yes
       4 	Yes 		No 		No
       5 	Yes 		No 		Yes
       6 	Yes 		Yes 		No
       7 	Yes 		Yes 		Yes

Examples

    drw-r--r-- = (4+2+1)(4)(4) = 744
    
    User = (read/write)
    Group = (read)
    Other = (read)

Set all the members(user, group, other) for a file to Read & Write

 chmod a=rw example.data

Set the User to Read, Write, & Execute

 chmod u=rwx example.data

Add the Write permission to the Group for a file.

 chmod g+w example.data

Remove the Read & Write from the Other membership of a file.

 chmod o-rw example.data