> > Hello, > > I am running a command as part of my script on a Unix box for which I need > to su to a different username. > > This su requires a password as well. > > I could not find any option of passing the password in su. > > Tried the shell script solution of here docs : > > su <<TillEnd > admin > test > TillEnd > > But even this does not work. > > Could anyone please guide me how to su in a script (shell / perl) ? > > I cannot have my username added to the /etc/sudoers to execute commands as > root... > > Thanks in advance > -aman >
Can you 'setuid' the script that needs to be called with the special privileges? Then shell out to that script for the processing it needs to do... I am not much of a setuid expert but this should work based on my understanding of it. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>