I rent a VPS and they migrated my account to another machine, causing passive FTP to stop working. I am trying to get it working again without luck.
Active mode works fine, but when it is on passive mode, it connects but it will not list the contents of the directory. I cannot use active mode as a tool I am using to connect to the server does not seem to support it.
The server is using Ubuntu 20.04.
I think it is using vsftpd. Running sudo service vsftpd status outputs:
root@localhost:/etc# sudo service vsftpd status
● vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-07-18 03:53:04 UTC; 7s ago
Process: 70918 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
Main PID: 70929 (vsftpd)
Tasks: 1 (limit: 458)
Memory: 816.0K
CGroup: /system.slice/vsftpd.service
└─70929 /usr/sbin/vsftpd /etc/vsftpd.conf
The vsftpd config (/etc/vsftpd.conf) looks like this:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
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
ssl_enable=NO
# I added these lines:
pasv_min_port=4000
pasv_max_port=4100
I opened port 4004 and restarted the service:
sudo ufw allow 4004
sudo service vsftpd restart
But still no luck.... it doesn't even connect now, my when connecting in passive mode on port 4004, my FTP client is showing:
Status: Connecting to 12.34.56.78:4004...
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server
Suggestions?