Using Pure-ftpd with extauth and not wanting to fire off manual pure-authd pure-ftpd commands

2.8k Views Asked by At

Pure-ftpd has the option to create your own authentication module, however it requires runtime work to get it up:

Now, we have to run pure-authd and pure-ftpd, to connect them through a
local socket and to tell pure-ftpd to use our external authentication module:

pure-authd -s /var/run/ftpd.sock -r /usr/bin/ftp-auth-handler &
pure-ftpd  -lextauth:/var/run/ftpd.sock &

That's all. Now, we can only log in as 'john', as all FTP authentication is
done by the shell script.

Is there a way to accomplish these two commands in the configuration?

2

There are 2 best solutions below

0
On

I had the same problem yesterday and solved it like this: As far as I found out you can't put "pure-authd -s /var/run/ftpd.sock -r /usr/bin/ftp-auth-handler &" into the config file, maybe edit pure-ftpd-wrapper to start/stop it with pure-ftpd...

For the parameter "-lextauth:/var/run/ftpd.sock", on debian: create the file /etc/pure-ftpd/conf/ExtAuth with the path to the socket as the content (e.g. /var/run/ftpd.sock) then, go to /etc/pure-ftpd/auth and create a sym-link named ExtAuth to the just created conf/ExtAuth file: ln -s /etc/pure-ftpd/auth/ExtAuth /etc/pure-ftpd/conf/ExtAuth

that isn't exactly what you wanted to know, but at least you can use the init.d script to start/stop pure-ftpd... (and start pure-authd yourself)

0
On

I don't think you can do this in the configuration, however you can run pure-authd automatically from /etc/inittab:

PAU:23:respawn:/usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/bin/ftp-auth-handler

After saving /etc/inittab run init q to reload it.