Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use SFTP over OpenSSH as a small FTP server. However I would like to use a mounted hard drive or USB stick as the chrooted directory for the user.

As far as I see, chrooting is achieved through an entry like this in /etc/ssh/sshd_config

Subsystem sftp internal-sftp

Match Group sftp
    ChrootDirectory %h
    ForceCommand internal-sftp
    AllowTcpForwarding no

But I would like to replace the ChrootDirectory %h through something like ChrootDirectory /media/user/usb-stick.

This does not seem to work as of right now and I think this is due to the fact that the access rights are not correct. Everey auto mounted device has read and write access only for the currently logged in user. How can I change this?

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.