Showing results for 
Search instead for 
Did you mean: 

FTP Server problems

Posts: 5
Registered: 24-09-2011

FTP Server problems

I have a Netgear ReadyNas which has an inbuilt FTP server and I am trying to set this up for external access. This works perfectly inside my network and fine from my parents who are also on plusnet. Now this basically works for other people (sky and my work) in that it's possible to login but trying to change a directory or transfer files fails. Basically inside of my home network or from my folks place it looks like this
Command: MLSD
Response: 150 Opening ASCII mode data connection for MLSD
Response: 226 Transfer complete
Status: Directory listing successful
Command: MLSD
Response: 150 Opening ASCII mode data connection for MLSD
Error:       Connection timed out
Error: Failed to retrieve directory listing
Any ideas?
Aspiring Pro
Posts: 1,091
Thanks: 39
Fixes: 2
Registered: 26-08-2010

Re: FTP Server problems

You probably need to set the remote FTP client to be using passive (rather than active) mode. The problem with FTP (or one of them - there are many) is that it requires two connections to be made: one for control and one for data. Establishing the control connection is easy, and works without a problem through NATs and firewalls, however opening up the data connection is the difficult bit because NATs and firewalls are connection/state-based (and usually biassed for one-way operations) and hence it can be difficult to get this second (data) connection up at all.
In active mode the client sets the data port for the server to connect to but the server is often not allowed to establish a data connection because the client's NAT or firewall is unaware of what the client agreed and hence sees the attempt as an unsolicited connection and drops it. Control traffic such as logging in and sending commands work, but in the absence of a data channel things such as directory listings and file transfers then fail.
In passive mode the client tells the server to pick a data port, which the server then does, and then the client initiates a connection to it like it did with the initial control connection. The client's NAT and firewall are quite happy with this approach - it is exactly the sort for behaviour they are used to - and hence the connections are then established. The server's NAT and firewall (if present) may also need ports poking through in accordance with how the server is configured.
A command line FTP client is usually put into passive mode by simply issuing the 'passive' command once logged in. GUI clients will also have a setting somewhere.
If you can, I'd drop FTP entirely and use SFTP instead (a cursory Google search suggests that ReadyNAS does support it but needs a bit of tweaking to enable). Not only is it more secure (encrypted) but it avoids the horrible mess of multiple ports that FTP requires.