Silky Manwani wrote:
Hello,

I want to write a perl script to switch user (to root). The problem is that since it asks for the password, I am not sure how I would pass it thru the script. I know I can run the "su root" with the system command in perl, but how do I take care of passing the password.

Thanks.




http://expect.nist.gov/

spawn /bin/su $userid "-c /usr/bin/passwd"

However no matter HOW you decide to do it the solution will not be secure; you might want to see if suid scripts are secure on your system and take that route...

-Bill-
__Sx__________________________________________
http://youve-reached-the.endoftheinternet.org/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to