Sunday 31 March 2013

Restrict users access to only their home directory in vsftp

If you want to restrict FTP users to have access only their home directory but not outside of their own directory. You have to setup chroot.

1. open vsftpd configuration file
vi /etc/vsftpd/vsftpd.conf

2. Uncomment the below line
$ chroot_local_user=YES

3. Save and close the file. Restart vsftpd.
$ /etc/init.d/vsftpd restart

As a result FTP users can't access directories other than their home.

ftp> cd /home
550 Failed to change directory.

Thats it.