1

I just installed VSFTPD on my Ubuntu system, but it doesn't seem to work properly.

In the config file i only changed the "local_enable", "write_enable" and "listen" to YES.

When I use "netstat -tanp" or similar commands they only show me "22:sshd" but nothing on port 21.

I tried restarting VSFTPD and i tried restarting my whole VPS. Reinstalling VSFTPD didn't help either.

The weird thing was: Before i restarted my VPS for the first time it was listening on IPv6 Port21, but now it doesn't even listen on that anymore.

I tried everything that google told me but nothing works. It's a fresh installation of ubuntu 16.04.4, and vsftpd is version 3.0.3

(when i try to just type "vsftpd" into my console, it tells me "500 OOPS: ruin two copies of vsftpd for IPv4 and IPv6)

TL;DR: VSFTPD not listening on Port21, any tips why?

1
  • Could you provide output from command lsof -i :21?
    – mariaczi
    Jul 5 '18 at 13:17
1

I had just resolved a similar problem. In order to get it working on IPv4 I made these changes to /etc/vsftpd.conf

listen=yes
listen_ipv6=NO
listen_address=<Public ipv4 address>
0

This is because vsftpd can only listen on either IPv4 or IPv6. By default, vsftpd binds to the IPv6 socket. However, also by default, the kernel automatically opens and binds the equivalent IPv4 port (ref)

# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=YES
0

99% of the time there is a config issue within the vsftpd.conf file ... check your status of vsftpd ... it's probably erroring out like below:

root@localhost:~# sudo systemctl status vsftpd
 vsftpd.service - vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-03-13 02:40:20 UTC; 32s ago
  Process: 538 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/S
  Process: 539 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
 Main PID: 539 (code=exited, status=2)

Mar 13 02:40:20 localhost systemd[1]: Starting vsftpd FTP server...
Mar 13 02:40:20 localhost systemd[1]: Started vsftpd FTP server.
Mar 13 02:40:20 localhost systemd[1]: vsftpd.service: Main process exited, code=exited,
Mar 13 02:40:20 localhost systemd[1]: vsftpd.service: Failed with result 'exit-code'.

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.