rpm -qi sudo

To do what you want, add the user into /etc/sudoers with the appropriate
access, and type:

$ sudo -s

You'll find that your default directory has not changed, and you're using
your own .bash_history.  However, it re-reads your .bash_history for your
new shell, and it seems like the current history hasn't been written to that
yet, so it may not be quite perfect for what you want.  You could combine
that with a history write as so:

$ history -w ; sudo -s

    .../Ed

Ed Wilts
Mounds View, MN, USA
mailto:[EMAIL PROTECTED]
----- Original Message -----
From: "John P Verel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 9:15 PM
Subject: Re: Bash: How to control su: path, pwd, history, etc?


> su - starts a login shell for root.  Info page says:
>
> su - Make the shell a login shell.  This means the following.  Unset all
>      environment variables except `TERM', `HOME', and `SHELL' (which
>      are set as described above), and `USER' and `LOGNAME' (which are
>      set, even for the super-user, as described above), and set `PATH'
>      to a compiled-in default value.  Change to USER's home directory.
>      Prepend `-' to the shell's name, intended to make it read its
>      login startup file(s)
>
> So, this does two things I don't want:
> Change to ~/root
> Uses root .bash_history.  I want to use the john's history
>
>
> On 01/23/02, 07:04:02PM -0800, David Talkington wrote:
> >
> > Cameron Simpson wrote:
> >
> > >su root -c ". /etc/profile; . /root/.bash_profile; export
HISTFILE=$HISTFILE; exec bash -i'
> >
> > How does that differ from the effect of 'su -'?
> >
> > - -d
> >
> > - --
> > David Talkington
> --
> John P. Verel
> Living Proof That Low Tech Beats High Tech!
>
>
>
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
>




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to