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.



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:

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”.


Thanks Eric !