Installing vsftpd - 500 OOPS: could not bind listening IPv4 socket?

39,382

Solution 1

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.

Solution 2

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
    
Share:
39,382

Related videos on Youtube

gskierk
Author by

gskierk

Updated on September 18, 2022

Comments

  • gskierk
    gskierk over 1 year

    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?

    • goldilocks
      goldilocks about 9 years
      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.
  • 把友情留在无盐
    把友情留在无盐 over 3 years
    By the way, hi and welcome to Unix Stackexchange. I see you are new to this site. If you want to share your experience, you can always start a new thread, describe your problem in the question, and add an answer for that yourself.
  • Kiopwias
    Kiopwias over 3 years
    Thanks for your welcome and reminding.Maybe it was a different case with another solution. @把友情留在无盐
  • Diwakar SHARMA
    Diwakar SHARMA over 3 years
    this was my issue xinedtd was occypying ftp port 21