Ubuntu – Setup Jailed FTP user account in vsftpd

1. Edit /etc/vsftpd.conf as follow.
/etc/vsftpd.conf

chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

 

2. Create the /etc/vsftpd.chroot_list and enter the usernames which you want to jail.
/etc/vsftpd.chroot_list

userA
userB
userC
...

 

3. By default, the chroot folder has to be non-writable. The simplest way is to change the user home folder permission but this is not a perfect solution. If you are looking for a better solution. please refer to this.

chmod a-w /home/<username>

 

4. Restart the vsftpd.

/etc/init.d/vsftpd restart

 

5. Connect to the server using any FTP client, the jailed FTP account should work.

Done =)

Reference:

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.