Problem restricting SFTP connection/navigation to virtual server's home directory

3 posts / 0 new
Last post
#1 Fri, 12/20/2013 - 11:45
pixelgamma

Problem restricting SFTP connection/navigation to virtual server's home directory

Every hours, I need to receive (from a independant supplier) a file into a special folder on my server. The supplier asked me to give him SFTP id's to connect on my server in order to send files. I have no other choice.

So from an existing virtual domain I've created a new FTP user and set the home directory to a website subdirectory called "uploads". First I tried to connect through SFTP using Cyberduck but the connection failed. So I went into "Edit Users > Other user permissions" and I set "SCP only" into "Login permissions" and the connection was finally established, butI saw I could navigate into every server folders so I decided to restrict to the "uploads" folder : I went into "Limits and Validation > FTP Directory Restrictions" and set the restriction to the Virtual server's home directory. I discovered that this setting didn't work when I connected throught SFTP, but worked when connecting through simple FTP.

So my question is : how to resctrict the SFTP connection (and navigation) to a special folder (and children, but not parents) ?

I hope you'll understand me, and sorry for my english.

Thanks

Fri, 12/20/2013 - 13:19
andreychek

Howdy,

As you discovered, that option only works for FTP connections. There isn't a simple way to do that for SFTP.

There is information about that here:

https://www.virtualmin.com/documentation/security/faq

It is possible to setup an SFTP jail, though it's not particularly simple. But there are documents describing how to do it that you can find on Google, just search on "sftp jail" or "sftp chroot".

-Eric

Fri, 12/20/2013 - 13:29 (Reply to #2)
pixelgamma

Thanks Eric !

Topic locked