FTP connection refused by server

Hi everyone,

I just made a fresh Virtualmin installation on a nude Debian 6.
I followed the tutorial to create a new FTP user but I get the “ECONNREFUSED - Connection refused by server” message.

My user name is “user1” on domain “test.com”.
The given FTP login (user1.test) doesn’t work.

Any idea ?

Thanks.

Howdy,

A connection refused error means that there’s a problem with either the FTP service, or with a firewall blocking access to it.

Is your server running behind a NAT router, or other firewall? If so, you’d need to make sure you setup access to FTP on your server.

Also, does your ISP allow access to FTP? Some ISP’s block certain ports, you’d want to make sure your ISP isn’t blocking the FTP port.

Lastly – you may want to make sure that the FTP service is running. You can do that by running this command:

netstat -an | grep :21

in same status i dont have any messages :((

w8@hedefsunucu:~$ sudo netstat -an | grep :21
w8@hedefsunucu:~$

Howdy,

It sounds like the FTP service may not be running in your case. If you restart the FTP service, does that resolve the issue you’re seeing?

-Eric

no… i restart many times…
my /etc/hosts
127.0.0.1 localhost.localdomain localhost
95.9.190.95 hedefsunucu.hedefparca.com hedefsunucu

sudo service proftpd status:
● proftpd.service - LSB: Starts ProFTPD daemon
Loaded: loaded (/etc/init.d/proftpd)
Active: active (running) since Wed 2016-03-16 00:38:10 EET; 5h 44min ago
Process: 455 ExecStart=/etc/init.d/proftpd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/proftpd.service
└─572 proftpd: (accepting connections)

telnet localhost 21
Trying ::1…
Trying 127.0.0.1…
telnet: Unable to connect to remote host: Connection refused

w8@hedefsunucu:~$ sudo proftpd --configtest
Checking syntax of configuration file
2016-03-16 08:11:21,225 hedefsunucu.hedefparca.com proftpd[3945]: mod_dso/0.5: module ‘mod_sftp.c’ already loaded
Syntax check complete.

hedefparca.com is not registered, your configuration might be using this as a default hence it fails.

I am not 100% sure but you need to check if Proftp is running by using
service proftpd status

I am not 100% sure on the command since I am not using debian. If proftpd is running, it is on another port and the reason why netstat -an | grep :21 return null.

Base on experience, proftpd only ask me for the username in this format… username and not username.domain

i use an other domain… i write it just for i do not make advirtasement…

service proftpd status ● proftpd.service - LSB: Starts ProFTPD daemon Loaded: loaded (/etc/init.d/proftpd) Active: active (running) since Wed 2016-03-16 00:38:10 EET; 5h 44min ago Process: 455 ExecStart=/etc/init.d/proftpd start (code=exited, status=0/SUCCESS) CGroup: /system.slice/proftpd.service └─572 proftpd: (accepting connections)

sudo proftpd --configtest
Checking syntax of configuration file
2016-03-16 08:11:21,225 hedefsunucu.hedefparca.com proftpd[3945]: mod_dso/0.5: module ‘mod_sftp.c’ already loaded

maybe problem “mod_dso/0.5: module ‘mod_sftp.c’ already loaded”…

I just wanted to chime in that I have the same problem on a fresh Debian 8 box. ProFtpd itself reports it’s running but there is no process listening in on port 21. Fresh install with 0 changed settings to proftpd. (I double checked and it’s configured for port 21)

sudo service proftpd status

kristof@vps:/tmp$ sudo service proftpd status
● proftpd.service - LSB: Starts ProFTPD daemon
Loaded: loaded (/etc/init.d/proftpd)
Active: active (running) since Wed 2016-03-16 23:01:22 CET; 8min ago
Process: 11992 ExecStop=/etc/init.d/proftpd stop (code=exited, status=0/SUCCESS)
Process: 12011 ExecStart=/etc/init.d/proftpd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/proftpd.service
└─12018 proftpd: (accepting connections)

Mar 16 23:01:22 vps proftpd[12011]: Starting ftp server: proftpd2016-03-16 23:01:22,644 vps proftpd[12017]: mod_dso/0.5: module ‘mod_sftp.c’ already loaded
Mar 16 23:01:22 vps proftpd[12011]: .

Output of netstat -an | grep :21

-no output-

Output of netstat -an

kristof@vps:/tmp$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:11000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:20000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:38087 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN
tcp 0 0 37.97.153.139:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 448 37.97.153.139:22 178.119.154.34:54259 ESTABLISHED
tcp6 0 0 :::25 :::* LISTEN
tcp6 0 0 ::1:953 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
tcp6 0 0 :::587 :::* LISTEN
tcp6 0 0 :::2222 :::* LISTEN
tcp6 0 0 :::110 :::* LISTEN
tcp6 0 0 ::1:783 :::* LISTEN
tcp6 0 0 :::143 :::* LISTEN
tcp6 0 0 :::111 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::45137 :::* LISTEN
tcp6 0 0 :::53 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 37.97.153.139:80 80.69.67.10:61920 TIME_WAIT
udp 0 0 0.0.0.0:606 0.0.0.0:*
udp 0 0 127.0.0.1:616 0.0.0.0:*
udp 0 0 0.0.0.0:43847 0.0.0.0:*
udp 0 0 0.0.0.0:24009 0.0.0.0:*
udp 0 0 0.0.0.0:20000 0.0.0.0:*
udp 0 0 0.0.0.0:10000 0.0.0.0:*
udp 0 0 37.97.153.139:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 37.97.153.139:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp6 0 0 :::606 :::*
udp6 0 0 :::33422 :::*
udp6 0 0 :::52363 :::*
udp6 0 0 :::53 :::*
udp6 0 0 :::53 :::*
udp6 0 0 :::111 :::*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 75273 /var/run/clamav/clamd.ctl
unix 2 [ ] DGRAM 8226 /run/systemd/journal/syslog
unix 2 [ ACC ] STREAM LISTENING 46894 /var/run/dovecot/stats
unix 2 [ ACC ] STREAM LISTENING 46899 /var/run/dovecot/ssl-params
unix 2 [ ACC ] STREAM LISTENING 46901 /var/run/dovecot/login/ssl-params
unix 2 [ ACC ] STREAM LISTENING 46905 /var/run/dovecot/replicator
unix 2 [ ACC ] STREAM LISTENING 46909 /var/run/dovecot/replication-notify
unix 2 [ ACC ] STREAM LISTENING 46912 /var/run/dovecot/login/pop3
unix 2 [ ACC ] STREAM LISTENING 46918 /var/run/dovecot/log-errors
unix 2 [ ACC ] STREAM LISTENING 46922 /var/run/dovecot/ipc
unix 2 [ ACC ] STREAM LISTENING 46924 /var/run/dovecot/login/ipc-proxy
unix 2 [ ACC ] STREAM LISTENING 78671 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 46928 /var/run/dovecot/indexer-worker
unix 2 [ ACC ] STREAM LISTENING 46932 /var/run/dovecot/indexer
unix 2 [ ACC ] STREAM LISTENING 46934 /var/run/dovecot/login/imap
unix 2 [ ACC ] STREAM LISTENING 46936 /var/run/dovecot/imap-urlauth-worker
unix 2 [ ACC ] STREAM LISTENING 46938 /var/run/dovecot/token-login/imap-urlauth
unix 2 [ ACC ] STREAM LISTENING 46940 /var/run/dovecot/imap-urlauth
unix 2 [ ACC ] STREAM LISTENING 46946 /var/run/dovecot/doveadm-server

In Webmin -> servers -> Proftpd server, proftpd is running (only stop button is available)
also in Webmin -> others -> system and server status, the status is reported running

I couldn’t find any logged errors in /var/log/messages and /var/log/proftpd/:

kristof@vps:/tmp$ sudo tail /var/log/proftpd/*
==> /var/log/proftpd/controls.log <==

==> /var/log/proftpd/proftpd.log <==
2016-03-16 21:32:16,622 vps proftpd[29756] vps.smart-soft.be: ProFTPD 1.3.5 (stable) (built Tue May 19 2015 11:09:58 UTC) standalone mode STARTUP
2016-03-16 22:34:50,867 vps proftpd[29756] vps.snipped.com: ProFTPD killed (signal 15)
2016-03-16 22:34:50,867 vps proftpd[29756] vps.snipped.com: ProFTPD 1.3.5 standalone mode SHUTDOWN
2016-03-16 22:34:54,066 vps proftpd[8869] vps.snipped.com: ProFTPD 1.3.5 (stable) (built Tue May 19 2015 11:09:58 UTC) standalone mode STARTUP
2016-03-16 23:01:21,580 vps proftpd[8869] vps.snipped.com: ProFTPD killed (signal 15)
2016-03-16 23:01:21,581 vps proftpd[8869] vps.snipped.com: ProFTPD 1.3.5 standalone mode SHUTDOWN
2016-03-16 23:01:22,646 vps proftpd[12018] vps.snipped.com: ProFTPD 1.3.5 (stable) (built Tue May 19 2015 11:09:58 UTC) standalone mode STARTUP
2016-03-16 23:18:10,959 vps proftpd[12018] vps.smart-soft.be: ProFTPD killed (signal 15)
2016-03-16 23:18:10,960 vps proftpd[12018] vps.snipped.com: ProFTPD 1.3.5 standalone mode SHUTDOWN
2016-03-16 23:18:11,010 vps proftpd[13042] vps.snipped.com: ProFTPD 1.3.5 (stable) (built Tue May 19 2015 11:09:58 UTC) standalone mode STARTUP

KristofM, i exactly live same problem… it looks like Debian 8 problem because my laptop also Debian 8 and I take telnet localhost 21 telnet: Unable to connect to remote host: Connection refused

I found a solution:

w8@hedefsunucu:~$ ftp localhost 2222
Connected to localhost.localdomain.
SSH-2.0-mod_sftp/0.9.9
ftp> exit

this means connect with SFTP… i connected my server with SFTP…

I have a suspicion that the new FTP config that they rolled out not only enabled SFTP, but also (I think inadvertantly) disabled standard FTP in the process.

I’ll talk to Joe about that, but the solution in the meantime would be to either use SFTP on port 2222, or to edit /etc/proftpd/proftpd.conf, and disable the sftp portion in there.

-Eric

That was very strange and I think eric was right, they may have changed the default config

Wow, thanks! SFTP works indeed.

Strange though as in /etc/proftpd/proftpd.conf port 21 is configured. In /etc/proftpd/conf.d/sftpd.conf however port 2222 is indeed configured also.

I had this exact problem on a Debian 8. ftp stopped working after an update.

proftpd was running but not listening on port 21. Commented out these lines in /etc/proftpd/modules.conf.

#LoadModule mod_sftp.c #LoadModule mod_sftp_pam.c

Restarted proftpd. ftp on port 21 working again :slight_smile:

Thanks.

– Martin

Can confirm this is also the situation on a fresh install on Centos 6.

Confirming that this still the situation on Debian 8 with latest packages.

Seems deliberate to disable insecure FTP connections but caused a lot of confusion when attempting to enable FTP over TSL.

Same here, disabling these two lines and restarting had no effect !

#LoadModule mod_sftp.c
#LoadModule mod_sftp_pam.c

Any other solution to get around this problem ?

same here, on two fresh install of Debian Jessie 8 and Virtualmin 5.03.
proftpd service is running but nothing is listening on port 21
and the more surprising: even if I disable mod_sftp.c and mod_sftp_pam.c from /etc/proftp/modules.conf:

#LoadModule mod_sftp.c
#LoadModule mod_sftp_pam.c

proftpd still listens on 2222 port (proftpd service obviously restarted), that’s weird.
i’ll keep you updated if i find a workaround