I am setting up SFTP access to one of my machines running Linux with the Dropbear SSH server. When I SFTP onto the machine remotely, I can see the entire filesystem on it, even if I might not have write access. How to I control what directories a user can see when connecting to my machine via SFTP? For example, what if I only want to make one directory, e.g. /ftp/, visible and accessible? Thanks.


I believe you'll need to run your dropbear ssh server inside a chroot'd jail if you want to restrict it to certain directories.

If you were using a recent OpenSSH, I'd suggest using the ChrootDirectory setting in your sshd_config. It doesn't appear as though dropbear has a similar parameter, so you'll have to do it manually.

  • Thanks for the answer! But I don't know how to set up a chroot jail in Dropbear nor OpenSSH. Is there a link to more info? Or should I ask a new question? Thanks again. – hpy Feb 10 '11 at 21:28
  • here's a tutorial that covers much of what you'll need to do: howtoforge.com/chrooted-drop-bear-howto – jsbillings Feb 10 '11 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.