2

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?

2
  • Is 'liam' a system account or are you using vsFTPd's virtual users? Feb 22, 2012 at 16:51
  • A system account
    – Liam W
    Feb 22, 2012 at 17:19

2 Answers 2

4

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.

2
  • +1 for adding the home dir. I guess that is what I get for trying to answer this on my phone.
    – user89350
    Feb 22, 2012 at 18:03
  • i will +1 yours if i get my points, because u gave the half of it :]
    – p1100i
    Feb 22, 2012 at 18:04
1

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:

chroot_local_user=YES

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .