I cannot login to the server with FTP. The server reports: "Service not available, remote server has closed connection". What is wrong?

Article ID: 929 
Last Review: Oct,6 2008
Author: Maxim Kutov APPLIES TO:
  • Plesk for Linux/Unix

Symptoms

FTP connection to the server cannot be established. FTP client returns the error:

421 Service not available, remote server has closed connection

The following error message appears in the /var/log/messages log file:

getaddrinfo 'Hostname_Is_Here' error: Name or service not known
warning: unable to determine IP address of 'host.domain.tld domain'



Cause

This problem happens because FTP server cannot determine IP address of the server by hostname. You can check it with the following command:

ping `hostname`



Resolution

In this case you need to define the correct hostname in the configuration files below and restart network service.

/etc/hosts
/etc/sysconfig/network

The following example shows how to set up hostname "hostname.domain.tld" on RedHat systems.

/etc/hosts:
127.0.0.1 localhost  localhost.localdomein
11.22.33.44 hostname.domain.tld hostname

/etc/sysconfig/network:
HOSTNAME=hostname.domain.tld

# /etc/init.d/network restart


Where "11.22.33.44" and "hostname.domain.tld" have to be replaced with the real server IP and hostname accordingly.

Also, in the latest Plesk versions hostname can be set through Plesk CP on the Server->Preferences page.


Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields