LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-27-2007, 12:52 PM   #1
GavB
Member
 
Registered: Nov 2006
Posts: 54

Rep: Reputation: 15
Add pure-ftpd virtual user with PHP


Hi,

I need to be able to add new virtual users in pure-ftpd using PHP if possible. I've got the following problems:

When using SSH, you enter the 'pure-pw useradd' command and it asks you twice for the password so I'm not sure if it is possible to use the PHP exec command to do that (maybe I am wrong).

Another way I was thinking was to add the user to the /etc/pureftpd.passwd file but I'm not sure how to encrypt the password using PHP.

Quote:
Passwords are compatible with the hashing function used in /etc/passwd or /etc/master.passwd . They are crypto hashed with blowfish, md5, multiple-des and simple des, in this order, according to what your system has support for
I know how to encrypt using md5 but it doesn't seem to be using that so I'm assuming that the passwords are blowfish - is there a PHP function that I can use to encrypt using blowfish? If there is then I can just add the users to the password file using fopen.

Any help would be great so that I don't have to manually set up FTP users using SSH.

Thanks in advance.
 
Old 12-27-2007, 01:05 PM   #2
GavB
Member
 
Registered: Nov 2006
Posts: 54

Original Poster
Rep: Reputation: 15
Ignore me, I'm an idiot lol

It's easier than I thought! I simply used this:

$hash = crypt($password);

and it worked
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't enable virtual users on pure-ftpd G-Fox Linux - Networking 1 03-25-2010 04:51 PM
Need help setting up virtual users with pure-ftpd GavB Linux - Software 4 08-07-2009 05:52 AM
pure-ftpd and virtual servers mozilla Linux - Networking 1 05-03-2005 06:35 AM
pure-ftpd mysql virtual groups augustmacbizzle Linux - Software 0 04-27-2005 01:09 PM
pure-ftpd virtual users problem stofferthebest Linux - Networking 0 04-12-2004 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration