1

I am building upon gists/pure-ftpd to create FTP server instances in a Docker container. Here is my server start command, which I am hacking on:

# Args explained at http://debianhelp.co.uk/pureftp.htm
#
# -P -Force the specified IP address in reply to a PASV/EPSV/SPSV command
# -S -Connections are accepted on the specified IP and port
# -l -This is the authentication type, in the form "protocol:path"
# -E -Only allow authenticated users (if you wanted anonymous only you would substitute -e).
# -j -If the user doesn't have a home directory create it at first login.
# -R -Disallow the usage of the chmod command.
# -B -Instruct the standalone server to start in the background
# -g -Custom pidfile location (defaults to /var/run/pure-ftpd.pid)
# -d Verbose logging
/usr/sbin/pure-ftpd \
    -S $PUBLIC_HOST,21 \
    -P $PUBLIC_HOST \
    -p $MIN_PASV_PORT:$MAX_PASV_PORT \
    -g $PID_FILE \
    -l unix \
    -d \
    -E \
    -j \
    -R \
    -B

I am using the unix permission system, since I don't need the separate user database system. However, I am creating users and they don't seem to work, so I want to see some logs from PureFTPd, and the server just does not want to do any logging for me.

I have tried the user account via SSH on the same box, and this works, so I know the username and password is valid.

When playing around with this, I have removed the -B background switch in PureFTPd, but I see no logs on stdout. Much of the documentation/help around the internet says that logs are sent to syslog, but that's not running in this container, since it is a pretty bare Alpine build. I tried adding Rsyslog, while being conscious that "side projects" are a time-sink, and I got this:

rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
rsyslogd: activation of module imklog.so failed [v8.31.0 try http://www.rsyslog.com/e/2145 ]

So I have given up with that, and tried --with-altlog /var/log/ftp.log, and that hasn't written anything either.

I could switch to Ubuntu where syslog (etc) is probably available and running by default, but I don't want to do that only to find that logging is broken in PureFTPd anyway. Is there a simple fix?

Addendum

While it seems pointless (for my use case) to duplicate the Unix user system with a virtual FTP user database, I have tried this, and it works. Instead of -l unix, I use -l puredb:/etc/pureftpd/pureftpd.pdb. This gets my FTP server working, at least.

Update 2

I have fixed the Unix users problem. I believe that it was due to how I was creating users - they did not have a shell or a group. I have resolved that, and this mode of authentication now seems to work.

Answers on the logging aspect are still sought.

halfer
  • 233
  • 1
  • 5
  • 21

0 Answers0