# Problems with FTP server

## lpx

Hi,

I'm having problems with my box ftp server.

The process is running but the connections are refused.

How can I despite a situation like this?

Thanks,

Nuno

----------

## ncl

How are you trying to connect, what command, from lan, from localhost ... ?

Is it only the ftp server that is not working? Can you ping the machine?

Just describe what you're trying to do in more detail if you can.

Check if its listening for connections by running:

```
netstat -npat
```

Rule out firewall issues 

```
/etc/init.d/iptables stop
```

 or at least paste your rules here 

```
iptables -L
```

----------

## lpx

I'm trying to connect as I always did. From my local network.

central ~ # netstat -npat

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN      8134/rpc.statd

tcp        0      0 0.0.0.0:3493            0.0.0.0:*               LISTEN      9105/upsd

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      8148/mysqld

tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      8368/dovecot

tcp        0      0 192.168.1.2:143         192.168.1.1:50432       SYN_RECV    -

tcp        0      0 192.168.1.2:143         192.168.1.1:50431       SYN_RECV    -

tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      8124/portmap

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      8241/apache2

tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      8415/proftpd: (acce

tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      8113/dnscache

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      8219/sshd

tcp        0      0 0.0.0.0:3128            0.0.0.0:*               LISTEN      9029/(squid)

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      8850/master

tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      8241/apache2

tcp        0    888 192.168.1.2:22          192.168.1.1:50436       ESTABLISHED 19278/0

tcp        0      0 192.168.1.2:22          192.168.1.1:50191       ESTABLISHED 13521/sshd: neeii [

tcp        0      0 192.168.1.2:80          17.250.137.101:45930    TIME_WAIT   -

Curioulsy i don't have iptables command. Is this normal??

Thanks,

Nuno

----------

## ncl

Yes it's normal and it means it's probably not your firewall getting in the way.

It would still help if you pasted the whole command and resulting error. Also try checking proftpd logs.

----------

## lpx

This is the output for the iptables command:

central ~ # iptables -L

-bash: iptables: command not found

Couldn't find proftpd log....

central ~ # ls /var/log/

Xorg.0.log        clam-update.log   faillog           samba/

Xorg.0.log.old    clamav/           gdm/              sandbox/

Xorg.20.log       critical/         lastlog           scrollkeeper.log

Xorg.20.log.old   cups/             mail/             squid/

Xorg.8.log        dmesg             messages          vsftpd/

Xorg.8.log.old    dnscache/         mysql/            wtmp

acpid             emerge.log        news/             xdm.log

apache2/          everything/       portage/          xferlog

Do you know where it is located?

Thanks,

Nuno

----------

## ncl

I dunno but it must be configurable. See /etc/proftpd/proftpd.conf

Hmm, ok my bad. I could tell you don't have iptables installed from that previous post. I ment the command you use when trying to connect to the server.

----------

## Kaste

You define formats like this and then need to hook it into the files:

```

#Logging http://www.proftpd.de/HowTo-Logging.31.0.html

LogFormat               default "%h %a %l %u %t \"%r\" %s %b"

LogFormat               auth    "%v [%P] %a  %h %t \"%r\" %s"

LogFormat               write   "%m %F %h %a %l %u %t %s %b %D"

# Logging

    # file/dir access

    ExtendedLog     /var/log/proftpd/access.log READ write

    ExtendedLog         /var/log/proftpd/upload.log WRITE write

    # Record all logins

    ExtendedLog     /var/log/proftpd/auth.log AUTH auth

    # Paranoia logging level....

    ExtendedLog     /var/log/proftpd/paranoid.log ALL default

```

----------

## lpx

 *Kaste wrote:*   

> You define formats like this and then need to hook it into the files:
> 
> ```
> 
> #Logging http://www.proftpd.de/HowTo-Logging.31.0.html
> ...

 

I have inserted the block you described in proftpd.conf file and restarted proftpd. Nothing happened. 

No log file appeared. Do I need to do something else?

Thanks,

Nuno

----------

## Cyker

Are you usinf proftpd directly or is it being called through inetd or xinetd?

I know the default configs for xinetd deny ftp access, so you'd have to go find the appropriate xinetd thingys in /etc and change the disable = yes to a no...

----------

## eccerr0r

 *lpx wrote:*   

> 
> 
> ```
> tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      8415/proftpd: (acce
> 
> ...

 

This would imply you're running proftpd directly and not through inetd.

What do you mean by "refused" -- since it is listening, the tcp handshake should occur and at most you'd get a null connection that shuts up right away...did you get to enter in a password/userid?

----------

## lpx

 *Cyker wrote:*   

> Are you usinf proftpd directly or is it being called through inetd or xinetd?
> 
> I know the default configs for xinetd deny ftp access, so you'd have to go find the appropriate xinetd thingys in /etc and change the disable = yes to a no...

 

Well, sincerely i dont' know if is xinetd or inetd. To make a process start automaticly I use the rc-update add "process name" default

If it then uses xinetd i don't really. But i would like to know.

However i have search for the file /etc/xinetd.d/proftpd and changed the parameter. Then i made /etc/init.d/proftpd restart 

Tried to connect and nothing.

Also tried the following:

central ~ # telnet localhost 21

Trying 83.132.0.197...

telnet: Unable to connect to remote host: Connection refused

I really don't know what to do. I have used without any problems this box for years and from one moment to another the FTP is not working. I really don't remember what could cause this because I don't usually work with this machine. It only serves.

Any more tip?

Thank you very much for you effort in helping me.

With my best regards,

Nuno

----------

## ncl

 *lpx wrote:*   

> central ~ # telnet localhost 21
> 
> Trying 83.132.0.197...
> 
> telnet: Unable to connect to remote host: Connection refused

 

This is weird. It should be 127.0.0.1. Paste the contents of your /etc/hosts please. Also try same command with 127.0.0.1 instead of localhost. ifconfig -a could be interesting too.

----------

