2

I installed the pure-ftpd package (version 1.0.35-1) on an Ubuntu 12.04 box (an EC2 instance based on the standard Ubuntu 12.04 AMI).

The pure-ftpd daemon is running (verified with ps), though there is no PID file (expected one to be created by the /etc/init.d/pure-ftpd script).

Here's the resulting command that gets run by the init.d script:

/usr/sbin/pure-ftpd -l pam -O clf:/var/log/pure-ftpd/transfer.log -o -8 UTF-8 -u 1000 -E -B -g /var/run/pure-ftpd/pure-ftpd.pid

Here's my real problem: the ftp server isn't actually listening on any port (checked with netstat and nmap). So I can't ftp to the server (either locally using localhost or remotely using the public IP address).

I tried adding a Bind file to /etc/pure-ftpd/conf and restarting, but it didn't help.

When I installed pure-ftpd, it replaced inetd with openbsd-inetd, but did not run it since there were no services enabled. So inetd is not listening on port 21 either. (Apparently Ubuntu has a no-inetd-by-default policy, according to https://lists.ubuntu.com/archives/ubuntu-users/2010-September/227905.html .) I want to run pure-ftpd by itself (not with inetd) anyways, since the /etc/init.d/pure-ftpd script requires no inetd if you use the UploadScript feature.

I'm not familiar with how Ubuntu handles network services (and can't find any relevant docs besides generic man pages), so I'm probably missing something obvious. Nothing seems out of the ordinary with /etc/hosts.allow (empty) or hosts.deny (empty), and I didn't add any firewall rules (iptables -L shows that the firewall is in its initial state). I've checked the pure-ftpd docs; not sure what else to look at.

Any help would be appreciated, thanks!

Update: Here's the output from netstat:

$ sudo netstat -tulnp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      629/sshd        
tcp6       0      0 :::22                   :::*                    LISTEN      629/sshd        
udp        0      0 0.0.0.0:68              0.0.0.0:*                           395/dhclient3   

Update:

I am able to start pure-ftpd if I bind it to a non-privileged port (ie. >1024).

Also, when I started pure-ftpd with full debug logging, I saw the following in the syslog:

pure-ftpd: (?@localhost) [ERROR] altlog /var/log/pure-ftpd/transfer.log: Permission denied

Note that this directory is owned by root.

This suggests to me that, although pure-ftpd is running as root (according to 'ps aux'), it doesn't have root-like permissions that it would need to write to root-owned directories or bind to privileged ports. Anybody know what might be going on here?

5
  • 1
    Could you post the sudo netstat -tulnp output ?
    – golja
    Sep 18, 2012 at 5:38
  • sh -x /etc/init.d/pure-ftpd start?
    – quanta
    Sep 18, 2012 at 6:18
  • This may sound obvious, but isn't there nothing helpfull in /var/log/pure-ftpd/transfer.log ? Also just for debug run the pure-ftpd command on an custom port to see if the problem is port related (-S CUSTOM_PORT) and also add -d (debug mode == will log a lot of information in syslog). Hopefully this will help you solve the problem.
    – golja
    Sep 18, 2012 at 6:34
  • I'm just getting into pure-ftpd, but I'm wondering a few things: 1) what your init script looks like
    – mltsy
    Oct 8, 2012 at 18:24
  • Sorry: I'm just getting into pure-ftpd, but I'm wondering a few things: 1) what does your init script look like (does it use start-stop-daemon?), 2) What happens if you sudo that command yourself from a command-line, as a background task? Does it work?
    – mltsy
    Oct 8, 2012 at 18:30

1 Answer 1

0

For my case I had to explicit remove and install again pure-ftpd via apt:

systemctl stop  pure-ftpd
apt remove      pure-ftpd
apt install     pure-ftpd
systemctl start pure-ftpd

Or if you need to use pure-ftpd-mysql instead:

systemctl stop  pure-ftpd-mysql
apt remove      pure-ftpd-mysql
apt install     pure-ftpd-mysql
systemctl start pure-ftpd-mysql

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .