linux file permission (chmod chown setfacl ) - Serbipunk/notes GitHub Wiki

basic idea

Files and directories in Unix may have three types of permissions: read (r), write (w), and execute (x). Each permission may be on or off for each of three categories of users: the file or directory owner; other people in the same group as the owner; and all others. To change the mode of a file, use the chmod command. The general form is chmod X@Y file1 file2 ...

chmod a-w file (removes all writing permissions)
chmod o+x file (sets execute permissions for other (public permissions))
chmod u=rx file        (Give the owner rx permissions, not w)
chmod go-rwx file      (Deny rwx permission for group, others)
chmod g+w file         (Give write permission to the group)
chmod a+x file1 file2  (Give execute permission to everybody)
chmod g+rx,o+x file    (OK to combine like this with a comma)

u = user that owns the file
g = group that owns the file
o = other (everyone else)
a = all (everybody)

r = read aces to the file
w = write access
x = execute (run) access 

https://askubuntu.com/questions/303593/how-can-i-chmod-777-all-subfolders-of-var-www

to specific user

setfacl -m u:username:rwx myfolder

or

sudo chown username: myfolder
sudo chmod u+w myfolder

https://askubuntu.com/questions/487527/give-specific-user-permission-to-write-to-a-folder-using-w-notation