0

I need user_a to have read/write permission in /home/user_b without changing the level of access of user_b to its own home folder. Alternatively, have user_a have the same level of authorization than user_b within user_b home folder.

user_a is the "admin" account in my case and I need to copy files in the home folder of user_b with user_a account because I'm connecting using SSH and user_b is not allowed to SSH into the server.

Added bonus would be if it could be done automatically for everything in that folder in the future.

Chapo
  • 203
  • Could using groups be the answer? For example if both users were members of the same group and then you made the home directory belong to that group with read-write access. There might be a security flaw here which others will hopefully comment about if there is. See https://superuser.com/questions/280994/give-write-permissions-to-multiple-users-on-a-folder-in-ubuntu – Mehmet Karatay Aug 24 '20 at 09:32
  • @Mehmet nah he is the admin so no changes needed. He needs to use "sudo". – Rinzwind Aug 24 '20 at 09:35

1 Answers1

0

This is to add access for the directory only:

setfacl -m u:user_a:rwX /home/user_b

This is to add access for everything within the directory:

setfacl -R -m u:user_a:rwX /home/user_b

(of course this should be run from user_b or root account)

raj
  • 10,353
  • How can I verify that the changes are taken into account ? I ran your first command but I still can't create a file in the folder I'm supposed to have given access to. – Chapo Aug 25 '20 at 00:33
  • run getfacl /home/user_b - it should display the current permissions – raj Aug 25 '20 at 11:24