Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

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

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