Chroot/jail mechanism in ssh and sftp connections

Derek Ragona derek at
Tue Apr 10 16:04:44 UTC 2007

At 10:28 AM 4/10/2007, Thiago Esteves de Oliveira wrote:
>I want to use the chroot/jail mechanism in user's ssh and sftp 
>connections. I've read some
>tutorials and possible solutions to jail/chroot the users into their own 
>home directories. One is
>to install the openssh-portable(with chroot option turned on) from the 
>ports collection.
>I've installed the openssh-portable, but the jail/chroot mechanism didn't 
>I think it requires some configuration in its sshd_config file, but I'm 
>not sure because I have
>found nothing about jail/chroot in the openssh(sshd_config) man pages.

I have implemented a similar setup using vsftpd from the ports.  It works 
well for secure ftp when used with the filezilla client.  You can limit the 
ftp command in the vsftpd configuration file so users cannot get out of 
their home directories, which chroots them there.  You do need to add one 
thing to the accounts, which is to change their home directory in 
/etc/passwd adding an additional dot.  For instance if a users home 
directory is:

You'd need to change it to:

vsftpd is well documented and relatively easy to get setup and running.


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

More information about the freebsd-questions mailing list