I have to set up a FTP server on my machine. I have installed vsftpd using the command:

sudo apt-get install vsftpd

I then edited the configuration file vsftpd.conf in the location /etc. The file contains:

#Set the server to run in standalone mode
listen=YES

#Enable anonymous access
local_enable=NO
anonymous_enable=YES

#Disable write access
write_enable=NO

#Set root directory for anon connections
anon_root=/var/ftp

#Limit retrieval rate
anon_max_rate=2048000

#Enable logging user login and file transfers. /var/log/vsftpd.log
xferlog_enable=YES

#Set interface and port
listen_address=192.120.43.250
listen_port=21

The IP address 192.120.43.250 is the eth0 for my server. When I run the command

sudo vsftpd /etc/vsftpd.conf

I get the error:

500 OOPS: could not bind listening IPv4 socket

To check to see what was running on port 21, I ran the command:

sudo netstat -tulpn

And saw that vsftpd process id was 29383 so I issued the command:

sudo killserver 29383

And checked again. The vsftpd was still there, but with a different PID. Running the command:

sudo killall vsftpd

and

sudo killall -9 vsftpd

Does the same thing. I have already tried reinstalling. Anyone know what is going on and how to fix it?

  • An init service was probably installed along with this, and that's what keeps respawning the process. If this is ubuntu or some other upstart based system, check with initctl list | grep vsftp; if it is debian wheezy try grep vsftp /etc/init.d/* (try this with upstart as well in case it used a sysv style script). If you get something, you either need to disable the init service, or use service (debian/sysv) or initctl (ubuntu/upstart) to control it. – goldilocks Feb 16 '15 at 19:06
up vote 4 down vote accepted

Remember to comment out

listen=YES

in your vsftpd.conf file so that you don't run your vsftpd in standalone mode

It fixed the problem in my case.

You are getting this error probably because of xinetd ftp is running.

The procedure mentioned below will resolve the following errors:

A) 500 OOPS: could not bind listening IPv4 socket, for vsftpd

B) Server hangup immediately after connect, for ncftpget

Follow the procedure mentioned below to rectify the error:

  • To View which ftp service is running use:

    $ lsof -i | grep ftp (Become root and run this command)
    
  • To stop xinetd:

    $ sudo service xinetd stop
    
  • After stoping xinetd restart your vsftpd service by typing :

    $ /etc/init.d/vsftpd restart  (Become root and run this command)
    
  • Also check the vsftpd.conf with this one:

    listen=YES
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    use_localtime=YES
    xferlog_enable=YES
    secure_chroot_dir=/var/run/vsftpd/empty
    pam_service_name=vsftpd
    rsa_cert_file=/etc/ssl/private/vsftpd.pem
    
  • Hi Dasrohith, you can mark this answer useful – Ankit Raj Nov 6 '16 at 17:58

In my case the error was due to the process was running.

Try the next:

$ sudo service vsftpd restart

The service should restart with the new configuration parameters, if any.

Maybe in the standalone mode,you have started the vsftpd service.And you just need to kill the vsftpd process,not need to change the config file.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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