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


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.

  • 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 '14 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 '14 at 10:31
  • As for SFTP, found a solution which invloves /etc/ssh/sshd_config – Tejas Jayasheel Feb 13 '14 at 10:32
  • Change your parameters one at a time. – Keith Stokes Feb 13 '14 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 '14 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.