Re: [Hampshire] sudo

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] sudo
On 21/06/07, Alan Pope <alan@???> wrote:
> On Thu, 2007-06-21 at 16:39 +0100, Alex wrote:
> > On 6/21/07, Simon Reap <Simon.Reap@???> wrote:
> >         'sudo su' will give you a root shell - saves typing in sudo
> >         many times
> >         if you have lots to do as root.

> >
> > I know that, but i've always just used `sudo -s`; I wasn't aware that
> > `sudo su` gave you a shell too - doesn't sound right to me (although
> > i've just tried it and it works, obviously).
> >
>
> sudo su will give you a root prompt without the environment
>
> sudo su - will give you a root prompt *with* the root user environment
>


Yes, carrying your own environment into rootland can be a bit of a
gotcha. Another thing I find that makes me want to 'sudo su -' is that
sudo only does "real" commands, not bash builtins:

victor@ss07:~$ [1] sudo history
Password:
sudo: history: command not found

Admittedly, there aren't a lot of occasions when you might want to do
that; 'history' is the main one that I'm aware of. I've not found a
way round that yet.