Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: su in a script
Connor McDonald <connor_mcdonald_at_yahoo.com> wrote in message news:<3BB0C46C.2DB1_at_yahoo.com>...
> Daniel A. Morgan wrote:
> >
> > Robert Fazio wrote:
> >
> > > "ak" <a.kadivar_at_caramail.com> wrote in
> > > news:9oaef9$8p9$1_at_norfair.nerim.net:
> > >
> > > > Hello
> > > > 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.
> > >
> > > su - username -c "some command" is a common syntax, but the only user that
> > > can do this without a password is root.
> > >
> > > --
> > > Robert Fazio
> > > Senior Technical Advisor
> > > dbabob_at_yahoo.com
> >
> > Is it possible to put the password into an environment variable and read it
> > from there?
> >
> > Daniel A. Morgan
>
> No - sounds like you want something like 'sudo' which is a way of
> controlling access to privileged accounts
>
> hth
> connor
FWIW, I seem to remember that AIX has the concept of 'su groups' where people in the same group can 'su' to each other without supplying a password? Forgive my memory if I'm wrong, it was a few years back and I have a terrible cold today... :-( Received on Wed Sep 26 2001 - 05:31:38 CDT
![]() |
![]() |