Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

There seems to be quite a lot of posts about FTP login via vsftpd but none worked for me. I'm aware that FTP is not really secure but I have an uploader page which uses FTP to upload content to server. This content is not executed anywhere but just stored and I use clamAV for virus scanning these content, just in case.

Here's the commands that I tried.

sudo useradd -d /home/publicftp -m publicftp

Then vsftpd config

local_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd

All other properties are commented out. My problem is that from filezilla if I use port 21 (FTP) connection is timed out. However, if I use port 22 (SFTP), then publicftp can connect and access all folders - meaning he's not jailed.

share|improve this question
1  
port 22 is (almost certainly) using the SSH server and your vsftp config will have no impact on that. Since the connection timed out perhaps there's a firewall in the way or vsftp is not really listening. do you get anything from netstat -an | grep 21 or ps ax | grep ftp? –  user16081-JoeT Feb 13 at 5:18
    
vsftp is actually listening on port 21. I did not take a backup of vsftpd conf, so purged the package and reinstalled. FTP works with this fresh config. But if I modify it to aforementioned block of code, then bingo! it's gone. Trying to debug which particular property is causing the error. –  Tejas Jayasheel Feb 13 at 10:31
    
As for SFTP, found a solution which invloves /etc/ssh/sshd_config –  Tejas Jayasheel Feb 13 at 10:32
    
Change your parameters one at a time. –  Keith Stokes Feb 13 at 14:02
    
i'm going to guess that it's this line: secure_chroot_dir=/var/run/vsftpd/empty either it doesn't exist or the permissions are not right...? –  user16081-JoeT Feb 13 at 18:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.