0

I want to add a second SFTP user that can only view a couple of folders/files in a home folder. I already added a group sftp_users for the normal users but now I am searching for a solution to add a read only user for the same folder.

0

One solution might be:

  • Set a new group (e.g. sftp_users_ro)
  • Give the new sftp user the new group
  • set the following permissions to the folder: 775

The user and group which owner the folder will have read/write/execute permission in this folder.

The new sftp user will have read/execute permissions to the folder (without write permission)

See this Q&A for more info What is meaning of 755 permissions in Samba Share

| improve this answer | |
  • Thanks for your answer! Can you help me with the exact commands that I need to use? Thanks in advance! – Koen Mar 3 '17 at 14:46
0

You can use ACLs (Access control lists). You can grant read access to an user with:

  setfacl -m u:lisa:r file

However, your sftp server needs to support, so check that out before trying. Also, there're some clients which don't support Linux ACLs (I might be wrong but I think WinSCP still doesn't support ACLs).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.