7

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?

1
  • 1
    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
7

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.

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
    
1
  • this was my issue xinedtd was occypying ftp port 21 Feb 1 at 9:30
0

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.

0

If above solutions did not worked then you are in the same situation as I was in. Now let's resolve it.

First make sure to do listen=NO or comment the line that contain listen=YES and must set the port to either 8081 or standard ports. Then type ps -ef then a whole bunch of things appear like :

enter image description here

Then you extract the file in which you are interested in by typing the command :

ps -ef | grep vsftpd

Now, remember the PID number is in second column. Now, copy that number. Now you need to kill the vsftpd beacause it contains previous log and you just modified something into the vsftpd.conf file. Kill command is :

sudo kill <PID>

Ex. sudo kill 5392

Now, You are done with it.Now restart the server it will run perfectly.

0

In my case, uncommentting the following line in vsftpd.conf solved the problem:

write_enable=YES
-1

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.

-1

The error means your system already have a vsftpd runing.It seems like that vsftpd start from inetd.You should find out the pid of vsftpd with this command:

netstat -tulpn | grep vsftpd

And then kill the process:

kill <pid>

And restart vsftpd:

/usr/local/sbin/vsftpd &

That may work.I solved the problem in my case.

3
  • I don't think inetd spawns processes all the time or when no one outside is attempting to connect. And OP already says killing the pid doesn't prevent them from resurrecting. You say you solved the problem in your case, maybe it was a different problem then. Dec 29 '20 at 3:21
  • 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. Dec 29 '20 at 3:25
  • Thanks for your welcome and reminding.Maybe it was a different case with another solution. @把友情留在无盐
    – Kiopwias
    Dec 29 '20 at 3:55

Your Answer

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

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