well what php script have u tried can u just put on the source code of it
are u trying to create users or ru trying to give the existing users some priviledges
I'm trying to create user accounts in redhat linux 9 over the internet. I am using a php script to create accounts. There i used sudo commands to create user accounts. I could create the user account but couldn't give the pasword for that user. I tried to use md5 command to encrypt pasword. But in shadow file it seems to be different from those passwords created using passwd command.
Please help me !
well what php script have u tried can u just put on the source code of it
are u trying to create users or ru trying to give the existing users some priviledges
Thanks a lot.
I tried many many times and finally got the solution.
this is the code I used. Hope would be help somebody else also.
$stud="username";
$group="Group";;
$home="/home/".$stud;
$enc=crypt($Passwd);
$file = "sudo useradd -g $group $stud -c $group -e 2005-12-31 -p '$enc' -d '$home' ;sudo passwd $stud:$enc;sudo chown $stud:$group ";
$resu = exec($file);
Unless you need to use your PHP script to create user, you can check another useful tool from Webmin.com:
http://www.webmin.com
You can manage almost linux's function through its web interface (user management for example)
Regards
Bookmarks