Centos – FTP: Jail user to Home folder

centoscentos7ftpvsftpd

Using Centos7 and vsftpd I would like to chroot the user "testftp" to his home folder /home/testftp.
The client uses WinSCP on Windows.
The user testftp can reach the server and connects initially to his home folder.
However the user is still able to browse higher levels.

passwd:

testftp:x:1001:1001::/home/testftp/:/bin/bash

vsftpd.conf:

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

Home Folder testftp:
This has been modified with chmod 500 because of this line in the vsftpd.conf
(Warning! chroot'ing can be very dangerous. If using chroot, make sure that the user does not have write access to the top level directory within the
chroot)

dr-x——. 3 testftp testftp 73 Dec 5 10:44 testftp

Inside the Home Folder is another folder called ftp:

drwx——. 2 > testftp testftp 44 Dec 5 10:52 ftp

Best Answer

Try this...
vim into /etc/vsftp.conf and add -> allow_writeable_chroot=YES
restart server -> service vsftpd restart
-or-
exit vim and run this command -> chmod a-w /home/testftp
restart server -> service vsftpd restart