HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   Pure-authd not passing variables to pure-ftpd (

welshdemon 8th February 2011 02:58

Pure-authd not passing variables to pure-ftpd
Hi, after days of struggling, I hope somebody might have an idea.

I have set up pure-authd and pure-ftpd. They are both running, I have created the socket etc.

In my authentication module (a php script) for testing purposes I have done a vardump in to a file, and have realised that pure-authd is not passing on any variables (username, password of the current person trying to log in via ftp) to the PHP script.

Would anybody have any ideas why this is?

It has taken me about 3 days to write the authentication module (I am fairly new to PHP and Linux) which I am sure is working (have tested it vigorously on the command line and things), but after 10 hours wondering why it wouldnt work and messing about with the script, I have realised that the variables were never even getting in to the script in the first place! DOH!!!

I am running the processes such as this:

pure-authd -s /var/run/ftpd.sock -r /usr/bin/ftpauth.php &

/usr/sbin/ /etc/pure-ftpd/pure-ftpd.conf

(pure-ftpd.conf has this line in it and enabled: )
ExtAuth /var/run/ftpd.sock

Everything seems as if it is working other than this. For instance, when testing the setup with a very basic auth module which doesnt require a username or password (the basic module just passes "auth_ok:1" to pure-ftpd and the user is then logged in), I can log in to the FTP server fine.

But like I say, a vardump ($argv) on my proper PHP authentication script would suggest that no username or password are being passed to it.

If somebody has any idea I would be very grateful!



welshdemon 12th February 2011 00:47


As a newbie to PHP and Linux. I was trying to use getopt and argv and various other methods to get the variables in to the PHP script.

It turns out I had to use $_env in my PHP script.


I am posting this in case anybody ever gets stuck and stumbles across this thread from google.

All times are GMT +2. The time now is 06:28.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.