RE: [PHP] adduser on a Linux Redhat 7

From: Date: Wed, 27 Dec 2000 14:03:10 +0000
Subject: RE: [PHP] adduser on a Linux Redhat 7
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-31959@lists.php.net to get a copy of this message
actually, you can run: system("/usr/sbin/useradd -c \"$fullname\" -d /home/$username -s $shell -g $gid $username"); system("echo '$newpasswd' | passwd --stdin $username"); from a php page. only one hitch, gotta be root. So, would have to use something like suExec or a CGI wrapper to do it. And it isn't the most secure thing in the world. -----Original Message----- From: Richard Lynch [mailto:richard@zend.com] Sent: Tuesday, December 26, 2000 9:50 PM To: php-general@lists.php.net Subject: Re: [PHP] adduser on a Linux Redhat 7 > how can i make a script to adduser to a linux redhat 7? That would be extremely dangerous unless you *really* know what you are doing. You should only do this on a secure server. You should be very, very, very careful about who has access to the page that creates the user. You probably can't even exec() adduser, because the OS knows you're not on a real terminal, and the underlying code to get a password should only be done under controlled circumstances (IE a "real" terminal)... So I think you might need to alter the underlying files/directories by hand just to "fool" the OS into thinking adduser was called... That means you'll need to get the password and encrypt it using the same encryption method that your OS uses, which depends on what got installed. Be afraid. Be very afraid. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#31959) next »