Making a folder visible for a few selected users in Linux -


i share folder called 'files' user1 , user2 in linux account. there way set authorizations read write or execute these 2 users , keep secure other users? knowledge, possible usergroup whole.

thank you

if linux has "modern" filesystem (ext3/ext4,... )you can achieve posix acls:

  1. enable acls fs. --> required ext3 , ext4 on kernels older 2.6.38. other fs acl-support have them automatically activated.

    mount -o remount,acl / tune2fs -o acl /dev/<partition> 
  2. give user1 access folder files: (r/w/x)

    setfacl -m user:user1:rwx /home/philipovic/files 
  3. give user2 access folder files: (r/w/x)

    setfacl -m user:user2:rwx /home/philipovic/files 

if linux not support acls have create group:

  1. create group
  2. add desired users group
  3. chgrp directory group, , give permissions chmod:

     chgrp groupname /home/philipovic/files  chmod g+rwx /home/philipovic/files 

note: in above examples using r/w/x permissions , therefore giving users/group full controll! don't forgett change them desired permission.


Comments