Chroot in OpenSSH / SFTP Feature Added To OpenSSH

by on February 20, 2008 · 5 comments· LAST UPDATED February 20, 2008

in , ,

For regular user accounts, a properly configured chroot jail is a rock solid security system. I've already written about chrooting sftp session using rssh. According to OpenBSD journal OpenSSH devs Damien Miller and Markus Friedl have recently added a chroot security feature to openssh itself:

Unfortunately, setting up a chroot(2) environment is complicated, fragile and annoying to maintain. The most frequent reason our users have given when asking for chroot support in sshd is so they can set up file servers that limit semi-trusted users to be able to access certain files only. Because of this, we have made this particular case very easy to configure.

This commit adds a chroot(2) facility to sshd, controlled by a new sshd_config(5) option "ChrootDirectory". This can be used to "jail" users into a limited view of the filesystem, such as their home directory, rather than letting them see the full filesystem.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 Bryan February 21, 2008 at 2:19 am

Yes, this is a long time coming. You finally don’t have to jump through hoops now.


2 Bensode February 21, 2008 at 2:40 pm

Any ideas when this will get placed into production and out of CVS? Hoping that it will be available in apt sources soon.


3 Dave March 14, 2008 at 4:19 am

You mean I just did a whole upgrade to openssl, zlib, prngd, openssh, etc., and the chrootdirectory is still not in there. LOL!!! Looking forward to the release into production, and THANKYOU!!!


4 od April 9, 2008 at 3:49 am

this is awesome. thanks.


5 Webagentur November 5, 2008 at 3:16 pm

Thank you for this tutorial. That has me very helped.


Leave a Comment

Tagged as: , , , , , , ,

Previous post:

Next post: