Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i've created an user on ubuntu 10.04 and wanted to jail the user by disabling ssh shell and allow sftp. when there is no ChrootDirectory in the sshd_config the user can login just that it can see other sibling folders.

let's say i only want the user to access /var/www/vhost/ so that's the home folder of my new user is set to that.but the use could browse via filezilla everything under /var/www/vhost/*. i followed this post and so far that's the only kink. I would be glad if anyone can give me a tip. thanks

share|improve this question
Is the user using an ftp or sftp connection ? – Iain Aug 29 '12 at 16:52
am(using the user creds to login) using an sftp with filezilla – black sensei Aug 29 '12 at 17:02

You need to pay close attention to the notes about permissions on the ChrootDirectory section of the man page.

Specifies the pathname of a directory to chroot(2) to after authentication. All components of the pathname must be root-owned directories that are not writable by any other user or group. After the chroot, sshd(8) changes the working directory to the user's home directory.

So /var, /var/www, /var/www/vhost, /var/www/vhost/ should all look like drwxr-xr-x 22 root root 4096 date ....

share|improve this answer
Indeed it seems i have a problem understanding After the chroot, sshd(8) changes the working directory to the user's home directory. What does that mean? let's say i do sudo chown -R 711 root:root /var/www what's next? – black sensei Aug 29 '12 at 18:05

Your Answer


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.