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
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