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 have a VPS running CentOS5 with Apache 2.2 and mySQL, as well as VSFTPD for ftp. The user liam is a system user.

I want to make the /home/html directory the ftp root for the liam user, so that when the liam user logs in via an ftp client, he sees only the contents of the /home/html directory.

How could I do this?

share|improve this question
Is 'liam' a system account or are you using vsFTPd's virtual users? – Aaron Copley Feb 22 '12 at 16:51
A system account – Liam W Feb 22 '12 at 17:19
up vote 5 down vote accepted

First, you'll have to make the /home/html directory the home directory of the user liam. To do this, execute the following as root:

# usermod -d /home/html liam

You then need to set chroot_local_user=YES in the vsftpd config file.

There is a security aspect to using this setting, as described in this serverfault question.

share|improve this answer
Thanks, this worked :) – Liam W Feb 22 '12 at 17:45
+1 for adding the home dir. I guess that is what I get for trying to answer this on my phone. – Nic Young Feb 22 '12 at 18:03
i will +1 yours if i get my points, because u gave the half of it :] – p1100i Feb 22 '12 at 18:04

If liam is a system account you can enable ch_root to jail the user in the home directory. In your vstpd.conf just change the following lines:


share|improve this answer

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.