Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Alright, so I am new at FTP and i'm trying to figure everything out as I go. I have set up a FileZilla server on a home machine and have successfully forwarded the ports to the router.

My father can access the server on his machine, sign in, and do everything perfectly. He is on windows XP using the basic ftp command on the command line.

I, however, am using Linux Ubuntu 11.10. Likewise, I am just using the basic terminal ftp commands. I can connect to the server, sign in, and change directories, but many other commands, such as "ls" or "dir" will cause the following error:

421 Service not available, remote server has closed connection

My dad has confirmed not receiving this error when doing the "ls" command and can actually see the files. I receive this error when using my Ubuntu 11.10 machine.

I have been googling these issues for the past 4 hours trying to find a solution, and I have found almost nothing. I came across this thread that describes the Original poster having the exact same problem that I seem to have, however it does not look like it has been solved.

http://hintsforums.macworld.com/archive/index.php/t-65259.html

I think I have some sort of setting on my Ubuntu 11.10 machine that is inhibiting the FTP communications, but I can't find out how to solve it anywhere. Looking for some insight into this problem and thanks in advance!

share|improve this question

migrated from stackoverflow.com Jan 14 '12 at 23:22

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

1 Answer 1

up vote 1 down vote accepted

FTP is a bloody stupid protocol which, in some configurations, involves the server making a connection back to the client on a port which the client tells the server. This means that tunnelling it through NATs and firewalls is a nightmare.

It's possible to work around this by setting 'passive mode', which makes the FTP client initiate both connections. See here for more information: http://slacksite.com/other/ftp.html

It's possible that your NAT/firewall isn't set up to allow FTP active mode. If your father's FTP client defaults to passive mode, that would explain why he can make it work but you can't. (Assuming you're connecting from outside the NAT/firewall.) Setting passive mode in your FTP client might help.

Alternatively, you can configure your NAT/firewall to proxy active mode FTP connections; there's a kernel module that does it (normally enabled by default).

I realise it doesn't answer your question, but you can also make the whole problem go away by using something other than FTP --- HTTP or rsyncd are good choices.

share|improve this answer
    
It was an issue with firewalls and not my system, which is great news. However I still would love to fully understand everything. It seems the last router I attempted to connect through had some firewall preventing the communication, and the one I am not connected through doesn't have that issue. For the sake of understanding, I would just love to better understand ways to work through that issue should it arise in the future. Am I able to work around connecting without having direct access to manipulate router settings? –  user1133050 Jan 14 '12 at 11:38
    
Setting passive mode in your FTP client should make it all work: all connections are then initiated from the client, and the router will automatically handle that. To handle active mode the router needs special knowledge of the FTP protocol. –  David Given Jan 14 '12 at 11:56

Your Answer

 
discard

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