My FTP service is not working. When I try telneting to ftp port, it gets closed by foreign host soon after connecting.
-bash-3.1# telnet localhost 21
Connected to localhost (127.0.0.1).
Escape character is ‘^]’.
Connection closed by foreign host.
The server is having Plesk control panel installed. So, ftp service is proftp which is started with xinetd. So, restarted xinetd and check if ftp is listening on port 21.
-bash-3.1# netstat -plan |grep 21
tcp 0 0 0.0.0.0:106 0.0.0.0:* LISTEN 2173/xinetd
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 3221/httpsd
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 2173/xinetd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2173/xinetd
Yes, it’s listening and xinetd didn’t show any errors. But, still FTP connection is in the old stated……Connection closed by foreign host.
Just check /etc/xinetd.d/ftp_psa to see how ftp service is getting started and started it manually. Hmm…….it shows errors now😦.
root@~#/usr/sbin/in.proftpd -c /etc/proftpd.conf
– IPv4 getaddrinfo ‘your.hostname.com’ error: Name or service not known
– warning: unable to determine IP address of ‘your.hostname.com’
– error: no valid servers configured
– Fatal: error processing configuration file ‘/etc/proftpd.conf’
The hostname entry “your.hostname.com” was missing in /etc/hosts.
hostname: Unknown host
So, added “your.hostname.com” to /etc/hosts and restarted xinetd service. That resolved the issue.