FTP from Linux gives "421 service not available, remote server has closed connection"

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 tora.us.fm
Connected to tora.us.fm.
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 tora.us.fm
PING tora.us.fm (64.79.220.195) 56(84) bytes of data.
64 bytes from tora.us.fm (64.79.220.195): icmp_seq=1 ttl=47 time=169 ms
64 bytes from tora.us.fm (64.79.220.195): icmp_seq=2 ttl=47 time=169 ms
64 bytes from tora.us.fm (64.79.220.195): icmp_seq=3 ttl=47 time=171 ms
^C

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

0

2 Answers

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 X.org 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 (ftp.mozilla.org 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.

3

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like