LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2003, 10:54 PM   #1
winsonlee
LQ Newbie
 
Registered: May 2003
Posts: 2

Rep: Reputation: 0
adding new ftp user through PHP


I would like to know how i can add a new ftp user and create a directory through using PHP ?? Coz as far as i knew, all the ftp login username and password are stored in a file call *.conf. Currently i am using vsftpd as my ftp server. The problem i am facing now is how i can encrypt the password using my PHP code so that the password are able to be read by vsftpd when the user login ?
 
Old 09-10-2003, 04:19 AM   #2
Andy@DP
Member
 
Registered: Aug 2003
Posts: 208

Rep: Reputation: 30
Firstly sorry it took so long to answer this.
There are two ways you could solve this. If the passwords are stored in the file *.conf using the standard Unix DES-based encryption algorithm or MD5 you could use the crypt() function to encrypt the password, php notes on crypt here: http://uk2.php.net/manual/en/function.crypt.php
Or you could use the exec() to use the encryption software and capture the result, php notes here: http://uk2.php.net/manual/en/function.exec.php

One thing to note is the crypt function will use MD5 encryption if its on the system, look at the notes to work out how to call explictily.

After that the rest is simple file manipulation!

Hope this helps!

Last edited by Andy@DP; 09-10-2003 at 04:24 AM.
 
  


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
PHP List /home/'user' then finger 'user' Caboose Programming 1 09-22-2004 04:12 AM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
adding imap support to php lmromena Linux - General 2 04-28-2004 10:24 PM
Adding FTP users in vsFTP groovybrandon Linux - Software 3 02-27-2003 09:16 AM
help with adding FTP users dkc_ace Linux - Software 1 01-10-2003 11:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:34 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