Why use a virtual machine? **RESOLVED**

Steve Lamb grey at dmiyu.org
Mon Dec 1 17:52:49 UTC 2008


Derek Broughton wrote:
> Donn wrote:
>> On Monday, 01 December 2008 10:10:39 Steve Lamb wrote:
>>> I want more than the sudo -i provides.  So for me when I
>>> want root I tell it just that, root.
>> I am sure there are plenty threads answering this... but .. what's the
>> essential difference between being 'su' and being 'sudo'?

> None.  Zero.  Zip. Nada.

    You know, until I read the "old blankie" comment I was feeling charitable
but...  How foolish of you.  If you didn't have me killfiled you'd know he
snipped the most important part and thus wouldn't look like a complete dolt
when I explain it.

> "sudo -i" gives you a login root shell.  Exactly what you would get if 
> you'd enabled the root account and logged in at a console prompt.

> What Steve wants is not "more than sudo -i", it's just the comfort of 
> the old blankie.

    Or the fact that when I said I put it in my .zshrc file would clue people
in to the fact that sudo -i and su - -p do two different things.  Namely sudo
-i logs me in as root complete with root's shell; that being bash.  Since I am
clearly not a bash user but a zsh user this is not desirable.

    The following shows the difference quite nicely.

{grey at olethros:~} echo $SHELL
/bin/zsh

{grey at olethros:~} sudo su - -p
root at olethros:~# echo $SHELL
/bin/zsh

{grey at olethros:~} sudo -i
olethros:~# echo $SHELL
/bin/bash

    Of course this got me to wondering if sudo could do the same thing, and it
can.  sudo -s, not sudo -i, will preserve the user's shell.  But then when I
put that alias together it was from a .zshrc file I've maintained since before
I was on machines that regularly used sudo (late '90s) so it was simpler to
just prepend sudo and call it a day than to worry about looking up -p.  The
effect is the same.  *shrug*




More information about the kubuntu-users mailing list