> -----Original Message-----
> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 5:13 AM
> To: Silky Manwani
> Cc: [EMAIL PROTECTED]
> Subject: Re: Perl script to switch user to root.
> 
> 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...

SUID scripts are not secure.
Modern OS's disable them.

(Windows is so insecure you don't need to be suid.. but that's another
 forum)

Locate one of the various 'sudo' style utilities and use it to
launch a script or command as root.


--
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