hey all, I'm very new to linux and php so forgive me if this is a dumb question.
I need to create a php command line script that will add a user to the system, to be used by the ftp server. I have it set up at this point that it creates the account just fine. The problem I'm facing is that even though I pass through the password when I create the account ie. -p $password, I still have to run the "passwd" command on the account and set the password manually before proftpd will let that account log in.
For the life of me I can't figure out how to run the passwd command from within the php. Obviously I can run it, but I have no idea how to programatically enter the password when prompted.
Just for more info, this is the command I run when creating the account. $username and $ password are passed into the function.
shell_exec("useradd ".$username." -g ftpusers -m -p ".$password." -d
/home/ftp/".$username."/ -s /bin/false);
now im looking to add something along the lines of:
shell_exec("passwd ".$username);
echo $password;
echo $password;
Just for the record, this last example is just for illustration.
Any help appreciated.