HOWTO grant access to a directory

If you want to share a directory with another shell user you can do so by setting the access control lists while logged in as your shell user.

This example shows how shell user userA can share an application directory myapp with another shell user userB:


Log in to SSH as userA.


Execute the following commands as userA:

setfacl -m u:userB:--x $HOME
setfacl -R -m u:userB:rwx $HOME/apps/myapp
setfacl -R -m d:u:userB:rwx $HOME/apps/myapp
setfacl -R -m d:u:userA:rwx $HOME/apps/myapp
chmod g+s $HOME/apps/myapp

Optional: to create a shortcut to the directory for userB, run the following command as userB:

ln -s /home/userA/apps/myapp ~/myapp