Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I wanted to restrict my SFTP users to their home folders only. So, after so many research and attempts, I found this question which successfully allowed me to chroot them in their folders.

Now, my problem is that the users in my SFTP group called (sftpusers) cannot upload any files inside their /home/public_html directories, only in folders which has the 777 permission.

How to solve this issue?

Question Link

To chroot an SFTP directory, you must

1) create an user and force root to be owner of it

cd /home mkdir john useradd -d /home/john -M -N -g users john sudo chown root:root /home/john sudo chmod 755 /home/john 2) Change the subsystem location on /etc/ssh/sshd_config:

Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp internal-sftp and create a user section:

Match User john ChrootDirectory /home/john ForceCommand internal-sftp AllowTCPForwarding no X11Forwarding no

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.