Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured sftp access for user using this guide: Linux shell to restrict sftp users to their home directories?

I have problem though.

I have taken all steps. I have chown'ed root:user the home folder and I set permissions to 755.

I can login normally using SFTP, however I can NOT transfer files, can NOT mkdir directories. If I change permissions to 777 it's ok do edit everything. However this is the thing I don't want. Additionally after exiting sftp and reconnecting then connection is reset by peer (due to setting 777).

Anyone had similar problem? What I am doing wrong?

share|improve this question
    
I tested that, it return "Connection closed" (no peer message). Well, I found semi-solution, so have I asked here. But possibly this could be moved there. –  Tomasz Durka Apr 3 '12 at 12:18
    
Are you logging in with "root" or "user"? –  Hugo Apr 3 '12 at 17:27
add comment

migrated from stackoverflow.com Apr 3 '12 at 16:43

This question came from our site for professional and enthusiast programmers.

1 Answer

In order to use the chroot restrict user to home dir scheme the top folder must be owned by root. You need to create folders under the users home folder owned by the user to allow upload. For example /home/user owned by root /home/user/uploads owned by user. Upload into the uploads folder not the users home folder..

share|improve this answer
add comment

Your Answer

 
discard

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