FTP stopped working

Martin Smith martin at rakupottery.org.uk
Tue Nov 28 07:45:47 GMT 2006

Charles Brewster wrote:
> Hello
> I have a LAN with 
> 	FreeBSD 5.3 PC webserver	(
> 	WinXP development machine 	(
> 	DLink Router/Switch		(
> For well over a year I have been using SmartFTP v1.5 to move files back and
> forth between the FreeBSD server and the WinXP development box. Today
> (Monday) SmartFTP wouldn't work and I'm trying to understand why, and fix
> it. Running FTP from a DOS prompt also doesn't work today, although I've not
> had any problem moving files that way previously.
> I can ping back and forth between the machines, also retrieve web pages from
> the server over the LAN. Both boxes are able to communicate with the outside
> world via the DLink router with no problem.
> The only significant event I can think of since the system (including FTP)
> was working fine was a brief power outage at the weekend during nearby
> thunderstorms. This took down the server (no UPS), and also left the DLink
> needing a power-cycle to re-start it. The WinXP box has a meaty Tagan PSU,
> and didn't lose power during the outage which lasted barely a second.
> When I try to connect (either with SmartFTP or DOS prompt FTP) I get:
> "Connected to"
> then the system seems to hang.
> After 20 seconds or so I get
> "Connection closed by remote host."
> Looking at what is happening on the FreeBSD box:
> (ftpd was being started by inetd, but I'm now starting it during bootup from
> /etc/rc.local as part of trying to solve this issue.)
> At startup
> netstat -naf inet
> shows the system LISTENing on port 21.
> After an FTP connection attempt 
> netstat -naf inet
> shows the connection ESTABLISHED with the WinXP box correctly identified
> using port 21
> After about 20 seconds (when the connection times out?)
> netstat -naf inet
> shows CLOSE_WAIT
> Looking back through /var/logs/xferlog 
> I can see that the response from the FreeBSD box to an FTP connection
> request is usually
> FTP LOGIN FROM as [username]
> but during efforts today that LOGIN log entry is not being generated.
> The username and pw used by SmartFTP are valid - I can use them to login at
> the FreeBSD console with no problem. The WinXP machine is included in the
> FreeBSD box 'hosts' file with the correct network address.
> Can anyone suggest further tests I might try to diagnose and fix this?
> Is it straightforward to try to recompile/reinstall ftpd on its own?
> I'd prefer to avoid a complete FreeBSD reinstall, as nothing else appears to
> be broken.

Since recompiling ftpd would only take a couple of minutes I would think 
that would be the first thing to try... /usr/src/libexec/ftpd
or you might try something from ports like proftpd

Martin Smith

More information about the Ukfreebsd mailing list