Thanks a lot David !

This sounds very do-able and highly efficient ;)

-aman

-----Original Message-----
From: David le Blanc [mailto:[EMAIL PROTECTED] 
Sent: 18 February 2004 13:55
To: Thind, Aman; [EMAIL PROTECTED]
Subject: RE: How to su in a script if su needs a pswd ?



aman,

Check out sudo's 'NOPASSWD' option.  IT allows the admin to give you (or
the source account)
access to 'sudo -u target_account "command"' without entering a
password.

The SET UID script thing should not work.  If it does, upgrade your OS
for
security reasons :-)

Cheers.
 

-----Original Message-----
From: Thind, Aman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 18 February 2004 2:18 AM
To: David le Blanc
Subject: RE: How to su in a script if su needs a pswd ?

Thanks David !

The only reason I need to su is that the account I need to su to has
write
permissions to a drive which my personal id does not.

Is it possible for me to be given access only to that drive through sudo
and
not to the whole disk as an ordinary sudo enabling me to run a command
like
mv or rm as root might do ? (I do not know of an option to make my
commands
run as a user other than root through sudo)

If yes then I guess I'll have to just plead to my Computer Security
division
to get this done :p

Thanks again,
-aman

-----Original Message-----
From: David le Blanc [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2004 19:56
To: Thind, Aman
Subject: RE: How to su in a script if su needs a pswd ?



Can you have your username added to Sudo to execute commands as the
other user?
(rather than root) ?

This is a long time problem, and sudo *is* the better answer.  Other
options usually
lead to running setuid programs with parameters to tell them what to do,
and that is
what sudo does best.
 

-----Original Message-----
From: Thind, Aman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 18 February 2004 12:21 AM
To: Perl Beginners
Subject: How to su in a script if su needs a pswd ?

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


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