1

I'm trying to use Filezilla on Windows to connect to a linux ec2 instance running vsftpd 2.3.5 (have also tried 2.3.2 with identical results) but the server keeps responding with 500 OOPS: vsf_sysutil_bind and then a secondary error that differs depending on whether I'm using active or passive mode (see logs below).

This setup was working fine a couple days ago. As far as I can discern, nothing has changed in the server's configuration but now you get thrown out immediately after connecting. I've restarted vsftpd but haven't yet restarted the server itself. What could cause this behavior, why would it crop up suddenly, and how can I fix it?

If I use active mode, the client-side log is as follows:

...
Response:   230 Login successful.
Command:    OPTS UTF8 ON
Response:   200 Always in UTF8 mode.
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/"
Command:    TYPE I
Response:   200 Switching to Binary mode.
Command:    PORT 192,168,1,101,250,178
Response:   200 PORT command successful. Consider using PASV.
Command:    LIST
Response:   500 OOPS: vsf_sysutil_bind
Error:  Failed to retrieve directory listing
Response:   500 OOPS: priv_sock_get_cmd
Error:  Connection closed by server

If I connect with passive mode, the client-side log is a little different:

....
Response:   230 Login successful.
Command:    SYST
Response:   215 UNIX Type: L8
Command:    FEAT
Response:   211-Features:
Response:    EPRT
Response:    EPSV
Response:    MDTM
Response:    PASV
Response:    REST STREAM
Response:    SIZE
Response:    TVFS
Response:    UTF8
Response:   211 End
Command:    OPTS UTF8 ON
Response:   200 Always in UTF8 mode.
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/"
Command:    TYPE I
Response:   200 Switching to Binary mode.
Command:    PASV
Response:   500 OOPS: vsf_sysutil_bind
Command:    PORT 192,168,1,101,249,253
Response:   500 OOPS: priv_sock_get_int
Error:  Failed to retrieve directory listing
Error:  Connection closed by server

Either way, the vsftpd log just says:

Tue Dec 27 23:32:18 2011 [pid 19875] CONNECT: Client "XXX.XXX.XXX.XXX"
Tue Dec 27 23:32:18 2011 [pid 19874] [username] OK LOGIN: Client "XXX.XXX.XXX.XXX"

My vsftpd.conf is:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
idle_session_timeout=600
data_connection_timeout=900
ftpd_banner=Welcome to FTP
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
pasv_enable=YES
pasv_promiscuous=YES
pasv_min_port=12000
pasv_max_port=12100
pasv_address=XXX.XXX.XXX.XXX
port_enable=YES
port_promiscuous=YES
user_config_dir=/etc/vsftpd/users

4 Answers 4

5

I was having trouble with this issue for the past few days, at first I followed the route of the one answer of installing proftpd. That did not pan out as I'd hoped so I tried pure-ftpd, failing that I reverted back to vsftpd, what solved the issue for me was increasing the amount of passive ports, I had previously only allowed the range 10090:10100, which is only 10 ports.

I've since allowed a greater range of ports for vsftpd and it has solved my issue, I no longer get that error when uploading long lists of files with 10 files at a time.

Hope it helps anyone who runs into this issue next time.

2
  • Increasing the number of available ports also resolved my issue.
    – Ryan
    Oct 1, 2018 at 10:05
  • I can confirm a tiny range of ports can be the cause. I am testing a vsftp server with only one passive data port. It works fine with one single connection, but if I try two simultaneous connection I receive this error: 500 OOPS: vsf_sysutil_bind. It's ok for my specific case, I just wanted to share.
    – Kar.ma
    Feb 25, 2019 at 10:21
4

I ended up getting rid of vsftpd and switching to proftd which is working fine in active and passive mode without any changes to the server's firewall settings. I'm still not sure what was causing the issue but if it's happening to you, a change in FTP server software might be the answer.

1

Deleting that "port_promiscous" line from vsftpd config and restarting vsftpd resolved issue for me.

1
  • EVERYONE please read: THIS is the fix for ACTIVE mode. I know it doesn't seem like it is but I assure 100% it is. When I first saw this answer I ignored it because this setting SHOULD have nothing to do with ports. Bizarrely though it does. I think there is a bug in vsftpd where when this flag is enabled, something extra is gettig done under the hood which is not documented. I did a lot more investigation on this with wireshark. What happens is, for some reason the server cannot bind to the data port of 20 when this setting is set to YES. Setting it to NO (or removing it fixes it). Crap prog!
    – Mucker
    Apr 28, 2023 at 8:07
0

This looks like a firewall issue.Could you double check that nothing else runs on ports 20/21 and passive ports are allowed through?

6
  • netstat -ntlp shows vsftpd listening on port 21 and nothing running on 20. If I stop vsftpd, I can use netcat to create connections with a remote server on ports 20, 21, and 12000-12100 (checked a handful of that range). I wouldn't be able to do that if it was a firewall issue, right? Dec 28, 2011 at 14:14
  • does this problem persist if you connect from the localhost?how about using windows command line client?
    – Sergei
    Dec 28, 2011 at 14:36
  • Yes, the problem happens connecting from localhost or from another linux server's ftp client. I can connect and log in and send a few other commands but as soon as I try to use LIST, GET or PUT, it returns "500 OOPS: vsf_sysutil_bind" and the next command returns "500 OOPS: priv_sock_get_cmd" and "421 Service not available, remote server has closed connection" Dec 28, 2011 at 14:48
  • can you check if connect_from_port_20=no (default setting) changes anything?is selinux in permissive mode?
    – Sergei
    Dec 28, 2011 at 14:52
  • I changed connect_from_port_20 to YES, restarted, and now I can connect using passive mode. I changed it back to NO, restarted, and I can still connect using passive, where I couldn't before. Progress, somehow! Active mode still throws the same errors with either setting though. I can settle for recommending passive if I have to but I'd really like to get active working as well. The people using this FTP aren't technical and explaining how to force a connection type isn't fun. And I'm still not sure why it started working or if it'll stop again. I don't appear to have selinux at all. Dec 28, 2011 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .