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?

Liam W
  • 173
  • 1
  • 1
  • 9

2 Answers2

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.

p1100i
  • 579
  • 2
  • 7
  • 15
  • +1 for adding the home dir. I guess that is what I get for trying to answer this on my phone. –  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
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