Table of Contents

Home tmade.de

Home Wiki

permission

chmod

Make a file execuable:

chmod +x script_name

or

chmod 755 script_name

Grant all rights:

chmod +rwxrwxrwx /path/to/folder/or/file

Remove all rights:

chmod -rwxrwxrwx /path/to/folder/or/file

chmod:

4 - read
2 - write
1 - execute  
--------------------
= 7

example:

chmod 777 /path/to/folder/or/file                    #all rights for owner,group and others
chmod 711 /path/to/folder/or/file == rwx--x--x
chmod ugo=rwx /path/to/folder/or/file                #u=user g=group o=OTHERS  
chmod u=rwx,g=r,o=r test

Another examples:

1755 gives drwxr-xr-t
2755 gives drwxr-sr-x
3755 gives drwxr-sr-t
4755 gives drwsr-xr-x
5755 gives drwsr-xr-t
6755 gives drwsr-sr-x
7755 gives drwsr-sr-t

ACL

setfacl / getfacl:

add:

setfacl -m g:users:rwx acl_test/      #set acl for group(rwx)
setfacl -m u:tmade:rwx acl_test/      #set acl for user(rwx)
setfacl -m u:tmade:--- acl_test/      #set acl for user (000/ ---)

remove:

setfacl -x g:users acl_test/          #remove acl for group(rwx)
setfacl -x u:tmade acl_test/          #remove acl for user(rwx)

set default acl for a directory:

setfacl -d -m u:tmade:rw /tmp/acl_test/

remove default acl for a directory:

setfacl -b folder/filename
shell/chmod.txt · Last modified: 2024/01/29 00:37 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki