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

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
  • 589
  • 2
  • 7
  • 15
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