Activities

January 2016
M T W T F S S
« Nov   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Ubuntu 14.04 : Setting up vFTPd server easily

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# apt-get install vsftpd
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:34 2016 [pid 12488] [demouser] FAIL LOGIN: Client "192.168.0.14"
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

pam_service_name=ftp

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/

Before
drwxr-xr-x 2 liju liju 4096 Jan 14 16:43 liju

After
#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

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>