I have an urgent requirement to setup a ftp server on one the Ubuntu desktop for a interim solution. I have installed vsftpd easily using apt command and started it.
root@web-119:/etc/apt# netstat -anlp | grep "21"
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 12362/vsftpd
Everything seems good and I had to setup chroot jail enviorment on this ftp server. I just immediately comment out the line “chroot_local_user=YES” and restart the vsftpd service.
But I’m hitting the error as shown below
Thu Jan 14 11:53:40 2016 [pid 12511] CONNECT: Client "192.168.0.14"
Finally I found from Google, that this vsftpd daemon using vsftpd pam authentication similar like standalone ftp user credentials. Like what Filezilla server did. So I have to disable that auth type to ftp . The line is become on /etc/vsftp.conf
Sometime you would hit by “500 OOPS: vsftpd: refusing to run with writable root inside chroot()”.
reason : VSFTP will not allow users to have write permission on their root folder. So you have to remove “write” permission from that user To achieve this, execute this command
chmod a-w /home/user2/
drwxr-xr-x 2 liju liju 4096 Jan 14 16:43 liju
#chmod a-w /home/liju/
dr-xr-xr-x 2 liju liju 4096 Jan 14 16:43 liju
The following values should be updated on “/etc/vsftp.conf” file to complete a perfect ftp server.
a. Uncomment write_enable=YES
b. Set FTP banner name : ftpd_banner=Welcome to MyOnline FTP service
c. Enable chroot jail : chroot_local_user=YES
d. Reset pam authentication to ftp : pam_service_name=ftp
f. Restart vsftpd service.
g. Execute this command on every user creation time : chmod a-w /home/users_home_folder