FTP stopped working

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Jan 9 00:08:17 PST 2006


On 2006-01-08 23:44, Jay O'Brien <jayobrien at gmail.com> wrote:
> I'm embarassed to say that FreeBSD was working so good for me
> that I forgot how to make it work. It was up for over 300 days
> when I rebooted today.

Oops :)

> All of a sudden I cannot access the computer via ftp. I have
> been able to do so using WS_FTP Pro on my Windows CP Pro
> computer, but now it doesn't even seem to accept the connect.
> The connect is via a local LAN, using fixed IPs.
>
> Guidance in a troubleshooting mode would really be appreciated.

First check that you truly have the ftpd binary:

    root at flame:/root# ls -l /usr/libexec/ftpd
    -r-xr-xr-x  1 root  wheel  96360 Jan  8 13:00 /usr/libexec/ftpd

Then see if ftpd is supposed to start as 'standalone' or as a
service controlled by inetd:

    root at flame:/root# grep ftp /etc/rc.conf
    root at flame:/root# grep inetd /etc/rc.conf
    inetd_enable="YES"
    root at flame:/root# pgrep inet
    651
    root at flame:/root# grep '^[[:space:]]*ftp' /etc/inetd.conf
    ftp     stream  tcp     nowait  root    /usr/libexec/ftpd       ftpd -l

If inetd is running, pgrep should report its PID as above.
Seeing no PID means that inetd failed to start.  Your system logs
at /var/log/messages will almost certainly have clues about the
reason of the failure.

Then, start checking if something *is* listening at port 21:

    root at flame:/root# netstat -na | fgrep LISTEN | grep [:.]21
    tcp4       0      0  *.21                   *.*                    LISTEN
    root at flame:/root# sockstat -4 -l -p 21
    USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
    root     inetd      651   5  tcp4   *:21                  *:*
    root at flame:/root#

If you don't have any indication how ftpd was started it's possible that
you manually fired up ftpd and then promptly forgot about it, until you
had to reboot.  Stability is nice, isn't it? :)



More information about the freebsd-questions mailing list