SFTP User with access to specific folder only - permission denied to create files

0

So I am trying to create a user that only has access to a specific folder inside my public_html folder. I have successfully created the user and I am able to login. I had some troubles logging in, in the start, because the folder had to be owned by root, before the sftp user could sftp.

So I followed this guide: https://serverfault.com/questions/584986/bad-ownership-or-modes-for-chroot-directory-component - instructing me to change ownership of the folder to root.

After doing this, I can successfully login, however, once I login, I am unable to add files or do anything within this folder, since it is owned by root.

I tried creating a group, and adding the root user and the sftp user as members of this group, but that didn't work either.

My work around was to create another directory inside the sftp folder, using root user, and then afterwards changing ownership to the sftp user, but this seems too hacky to me and addtionally adds another folder to the tree structure which I am not a huge fan of.

Any ideas how to allow a sftp user write access to a folder, while root remains the owner?

FooBar

Posted 2019-09-23T10:01:09.143

Reputation: 111

What permissions exactly did you assign to the folder? All relevant information should be in the question body. Please edit your question to include this vital information, specific to your machine, verifying the necessary content is included. – Ramhound – 2019-09-23T10:33:40.610

No answers