I can't get vsfptd working on Ubuntu 12.04.

my vsftpd.conf file looks like this, and I try to connect with a local user:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

Error message in FileZilla:

Response:   331 Please specify the password.
Command:    PASS ****
Response:   530 Login incorrect.
  • 1
    try restarting the vsftpd. >sudo /etc/init.d/vsftpd restart I had the same issue, but this worked for me. – v1h5 Jan 31 '14 at 18:10
  • 1
    Another thing to check : what is the login shell for the user. is that shell present in /etc/shells – user400315 Apr 22 '15 at 3:12
  • Please how can I modify the /etc/shells ? – user558008 Jun 17 '16 at 3:48
  • For me, there was just wrong format for the user in /etc/passwd - i needed to set the right home dir, shell, and the ,,, part. – Heanz Apr 19 '17 at 16:15
up vote 107 down vote accepted

Back up the config file before making a change;

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.back

and then edit vsftpd.conf (with vi or nano)

nano /etc/vsftpd.conf

Then make the following change

pam_service_name=ftp

Save your change and restart the ftp server (if you use nano hit CTRL+O & enter to save then CTRL+X to exit)

sudo service vsftpd restart

Source: VSFTPD configuration problems with 12.04

  • 3
    This problem also, can be solved in debian7 by this answer. – shgnInc Feb 1 '15 at 7:36
  • 1
    What is the rationale behind this one? – Joost Aug 20 '15 at 21:08
  • 13
    You are disabling default access control via PAM, because default "ftp" has no rules. The default pam_service_name=vsftp uses the file /etc/pam.d/vsftpd. This file by default requires FTP users to have a shell listed in /etc/shells and requires them not to be listed in /etc/ftpusers. – Jeroen Vermeulen - MageHost Sep 4 '15 at 14:41
  • Solved me the same problem on Ubuntu 14.04. Thanks! – Rotem Oct 11 '15 at 10:23
  • 3
    @JeroenVermeulenBVBA +1 you are right. I fear some people just don't know what's actually happening underneath and why it appears to "work". – Stphane Dec 7 '16 at 14:32

By default vsFTPd uses the file /etc/pam.d/vsftpd. This file by default requires FTP users to have a shell listed in /etc/shells and requires them not to be listed in /etc/ftpusers. If you check those 2 things your probably find what the problem is.

  • 1
    I think this should be the accept answer because it points out where is the problem. – PhoneixS Sep 26 at 11:18

I met this problem when I tried to login in with root and I just solved it.
my vsftpd: version 3.0.2

Solution:

check the following file(it contains list of users disallowed FTP access):

/etc/ftpusers 

Example

In my case, I commented out root from the file,then it worked.

Please make some changes in /etc/vsftpd.conf

pam_service_name=ftp

if you want to set access by default /var/www directory for local user you can do that with below line.....

local_root=/var/www

now save and exit......

restart vsftpd server using sudo service vsftpd restart

I did not need to change the vsftpd.conf. Only needed to make sure that a shell was set in my /etc/passwd file, that also was lited in /etc/shells.

So basically after useradd without a shell I needed to make sure the home directory was created and that the user had /bin/bash as it's shell.

  • Thanks that's what happened to me. The other solutions worked by removing all safety mechanisms, this one was actually solved the problem. – VinGarcia May 2 at 0:56

The suggested resolution did not work for me. I gave up on the ftp user, and switched my attention to the ubuntu user. I made sure there was a password associated with the ubuntu user.

I made sure to enable passive mode, and set local_enable=YES in the vsftpd.conf file.

I was able to authenticate just fine using the ubuntu account. And I successfully uploaded a large file to my Amazon Ubuntu FTP server. Clearly there was something amiss with the ftp user.

protected by Community Jun 17 '16 at 13:42

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.