Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to FTP to my hosting account from my Ubuntu machine, and got the following error, before I even got a login prompt:

$ ftp
Connected to
421 Service not available, remote server has closed connection
ftp> quit

I asked them if there is a problem with the FTP, but they checked it from a Windows machine and showed me that they can connect OK.

I can connect to the same host using ping, so it's probably not a network problem:

$ ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=47 time=169 ms
64 bytes from ( icmp_seq=2 ttl=47 time=169 ms
64 bytes from ( icmp_seq=3 ttl=47 time=171 ms

Is it possible that there is a problem to connect to FTP from Linux?

share|improve this question

migrated from Jul 8 '11 at 9:15

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

First of all, ping isn't really a connection. Think of it as the radar of the networking world. Just because something responds to it, doesn't mean you'll actually be able to get into that something.

Onto the problem at hand. I get a login prompt from that host with both a windows (Win7) machine and a linux system (Gentoo). This indicates that the FTP server software is accepting connections. The next step of the ftp process should be the authentication. Obviously, I don't have an account to login with, does your ftp client automatically login to the host? Is it using the credentials provided by your host or attempting to login anonymously?

Have you tried any other FTP software? Most browsers can not accept ftp connections (might be anonymous only, but still worth a try). The file manager for most systems I believe can handle ftp protocol connections, that might be another alternative.

Based on your comment, I can see 3 possible scenarios. First the remote server is blocking your IP address. Usually when an IP is blocked, it's done so at the firewall as opposed to on the specific server software. If you can reach the web portions of your server, then it's most likely not blocking your IP.

Another possibility are kind of a 2-in-1 type deal, both of which aren't too likely, but still possible. Your being blocked from making outbound FTP connections, either from your ISP or within the firewall of your distro. With regards to firewall on distro, unless you made changes to it, or are using SE-Linux (not 100% certain of this fact) then the FTP outbound traffic may have gotten blocked. Another possible reason outbound FTP is blocked is from your ISP for some weird reason. The best way to test either of these scenarios is try to FTP to a public FTP server that anyone can connection ( for example). If that gives the same error, then one of these two options is possible. Not much that can be done in this scenario (although there may be a workaround, see below).

A final possible workaround, which may not work if your blocked by server firewall, but might if it's the FTP traffic only that's blocked. Try SFTP (if that options available). It's an encrypted FTP connection over the SSH protocol. Most SSH and graphical FTP software can perform an SFTP connection. The only reason SFTP wouldn't work on the server side is if the server firewall blocks connections on port 22 (default SSH port) or SSH isn't enabled to begin with. If somehow you're blocked by ISP or by local firewall, SFTP usually can get around them as SSH is too popular a connection type to generally block outbound.

share|improve this answer
Thank you, I also tried to ftp from another Ubuntu computer and got the login prompt. But when I ftp from my home computer, I don't even get a login prompt (and there is no automatic login - it's just the simplest Linux ftp client). I tried to use other ftp clients from my home computer and got the same error. Is it possible that the remote ftp server blocks my IP address? – Erel Segal-Halevi Jul 11 '11 at 10:09
Updated answer with additional information based on your comment. – Matrix Mole Jul 11 '11 at 18:23
You are right! ftp Connected to 421 Service not available, remote server has closed connection So, it's probably my ISP or my distro. If it's my distro, is there a way I can change the settings? – Erel Segal-Halevi Jul 12 '11 at 18:25

I was facing the same issue. I tried SFTP and it works fine. Then I realized my server is not allowing the FTP connection.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.