Ubuntu 18.04 SFTP Group: one user has permissions, the other doesn't

0

Following this guide I have created a group sftp_users that I use for SFTP access only.

I created two users, user1, user2

I then added both to to group

sudo usermod -a -G sftp_users user1
sudo usermod -a -G sftp_users user2

Here is the /etc/ssh/sshd_config

Match Group sftp_users
    ChrootDirectory /projects/websites/
    ForceCommand internal-sftp
    X11Forwarding no
    AllowTcpForwarding no
    PasswordAuthentication yes

This allows them to login via SFTP but not shell.

Finally, for each websites I have I run the following:

sudo chown -R root:sftp_users /path/to/root_of_website*

Now, the problem is that when I SFTP into the server as user1 I can do whatever, create edit or delete files and folders. When I SFTP with user2, I cannot do anything with the error open for write: permission denied.

Both users are part of the sftp_users group and both users have the same configurations. What could the problem be ?

Here is a screen showing the permissions

enter image description here

Thank you.

EDIT Here is the output for the command namei -l /path/to/root_of_website*, where root_of_website is the root of one of the websites.

enter image description here

C. Ovidiu

Posted 2018-11-05T13:08:30.490

Reputation: 111

Please show namei -l /path/to/root_of_website*. – user1686 – 2018-11-05T13:34:40.537

@grawity Hi, I edited my post and I included a screen of the output. Thank you – C. Ovidiu – 2018-11-05T13:41:15.040

No answers