Create a sftp user who should have full access to another chrooted user folder

0

I have multiple chrooted users in ubuntu machine. I want to create another user who has full access to an already existing chrooted user. How can I achieve this?

Currently, I am using the following:

Match Group sftponly
    ChrootDirectory /home/%u
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

The users are like

/home/user1
/home/user2

# ls -lh /home
drwxr-x---  5 root    sftponly 4.0K Sep 21  2016 user1
drwxr-x---  3 root    sftponly 4.0K Jan  1  2018 user2

# ls -lh /home/user1/
drwxrwxr-- 3 user1 sftponly 4.0K Dec 19 11:52 data

Now, I want to create a user user3 and provide full access to /home/user1/ and also user1 should not gain access to user3 folder. maybe we can have something like

/home/user3/
/home/user3/data
/home/user3/user2/data

Both should be able to do sftp in their own folder.

Err0rr

Posted 2019-04-13T14:10:20.713

Reputation: 61

No answers