I installed dropbear on a embedded linux system, and I launch it by a

dropbear -r rsa_host_key

Everything works as expected, except that all users are able to "climb" outside of their home directory, until reaching /. Argh!

I remember having seen this phenomenon on a ftp server, but I haven't been able to find out the solution again.

What is the solution to keep them inside their home directory ?


It's not much of a "phenomenon", it's the way things work normally. The way Linux and most other operating systems are designed, there is no problem in being able to access the entire file system: there are only few files with private data, and those are restricted by default. The rest - well, I can't see much harm in being able to browse /lib or /usr... Besides, you cannot run any programs if you are denied access to those locations.

(As for other users' files - again, can be locked with a chmod.)

In some FTP servers, you have the option to enable chroot, which essentialy changes the / to represent the user's home directory. It's possible to do this with SFTP as well, although I'm not sure if Dropbear allows that (OpenSSH does). But when it comes to restricting interactive shell access to $HOME, it's... Well, I've seen it done on OpenBSD, but it caused a whole lot of problems.


You can use chroot with dropbear:


  • 1
    This is the usual mechanism for restricting access to the home directory. Otherwise the noticed file system visibility is normal to Linux/Unix systems. – Fiasco Labs Dec 24 '11 at 20:09

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.