Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: su in a script
On Thu, 20 Sep 2001 02:48:17 GMT, Robert Fazio
<dbabob_at_yahoo.nospam.com> wrote:
>> Is it possible to use su command in a Shell script in order to change
>> user
>> ? If yes how give it the password without typing it on the keyboard?
>> Thanks a lot.
>
>You are really in the wrong group, but the answer is yes and no. You can
>use su in a script. But only if the user executing the script is root.
You might also investigate the use of the "sudo" command which gives various accounts the right to execute certain specific commands as root. It is not part of most UNIX installations but can be found here:
http://www.courtesan.com/sudo/
Regards
Dale
![]() |
![]() |