Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th February 2011, 01:58
welshdemon welshdemon is offline
Junior Member
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default 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/pure-config.pl /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!

Regards,

Paul.

Last edited by welshdemon; 8th February 2011 at 16:23.
Reply With Quote
Sponsored Links
  #2  
Old 11th February 2011, 23:47
welshdemon welshdemon is offline
Junior Member
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

Fixed.

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.

$AUTHD_ACCOUNT = $_ENV["AUTHD_ACCOUNT"];

I am posting this in case anybody ever gets stuck and stumbles across this thread from google.
Reply With Quote
The Following User Says Thank You to welshdemon For This Useful Post:
falko (12th February 2011)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSL/TLS Pure FTPD bboy8012 General 6 9th December 2010 16:18
Pure FTPd not running andreasnrb Installation/Configuration 8 20th March 2010 01:01
Need help setting up domainpop with postfix kameelperdza Installation/Configuration 6 15th June 2009 07:49
cyrus-sasl won't install on my ubuntu9.04 kameelperdza Installation/Configuration 1 13th June 2009 10:28
passing variables to a javascript file using php badben Programming/Scripts 4 29th September 2007 06:36


All times are GMT +2. The time now is 01:55.


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