Why break sudo? (was: Installing software in user friendly way)

James Gray james at grayonline.id.au
Tue Jul 12 22:17:43 UTC 2005


On Tue, 12 Jul 2005 09:27 pm, Henning Kilset Pedersen wrote:
> Start a terminal. Give the root user a password if you havent (sudo
> passwd root - type YOUR user password first, then the new root password
> twice).

Hijacking this thread - apologies.

Pet peeve: why are so many people insistent on BREAKING the very security 
mechanisms that have been built into Ubuntu?!  You told a self-confessed 
noob, to break the config to a non-standard Ubuntu setup!

If people absolutely MUST have a root shell, use "sudo bash" or "sudo -s -H".  
Personally I don't see the big deal of either of those sudo incarnations 
versus "su -".  We're talking a handful of keystrokes here which, if it 
really bugs you, can be added as a shell alias anyway :) eg,
alias r="sudo -s -H"

Put that in ~/.bash_profile then all you need to get a root shell is to type 
"r" (as in "r"oot).  Enter your user password and voila!  I've even hacked 
by .bashrc so that my normal user account has a different prompt to my root 
shell:
if [ `echo $UID` -eq 0 ]; then
    PS1="\n\[\033[1;31m\]\u@\h - \[\033[1;32m\]\w\n\[\033[0;37m\]>"
else
    PS1="\n\[\033[1;36m\]\u@\h - \[\033[1;32m\]\w\n\[\033[0;37m\]>"
fi

That's a colour prompt (red=root, cyan=my normal user account), and not 
everyone's preferred "style" but have a play :)  My point is, that I can 
separate my normal user account and root shells so that it mimics the 
behaviour of a traditional *nix "root-enabled" setup without sacrificing the 
Ubuntu-way.

OK, I'm off my soap-box now.  Flame away :)

James
-- 
Really??  What a coincidence, I'm shallow too!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050713/1fe78b95/attachment.sig>


More information about the ubuntu-users mailing list