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

 
discard

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

Browse other questions tagged or ask your own question.