[ale] sudo shells [Was: Stupid Question Time]
David Tomaschik
david at systemoverlord.com
Fri Feb 3 10:31:50 EST 2012
On Fri, Feb 3, 2012 at 9:24 AM, mike at trausch.us <mike at trausch.us> wrote:
> Also, if you really want to get a root shell, you can say "sudo -i" and
> your wish will be granted (assuming it's your system and/or you have the
> right access of course).
>
> --- Mike
I prefer sudo -s, which gives you a plain shell (not a login shell),
thus preserving my environment. I like to think of it as "my shell
with elevated privileges" as opposed to "a root shell." I've gone to
great lengths to get ~/.vimrc, ~/.profile, etc. just right. I haven't
done the same for root's shell.
Also, I'll sometimes want to do things as a service account which may
not have a real shell in /etc/passwd (or a real $HOME). sudo -s -u
<user> gives me a much more sane environment in those cases.
It's personal preference, but I'm curious if anyone has motivations
for sudo -i. I suppose if you want your session to really be a "root
shell" with a "root-like" environment, it's useful.
FWIW, I have /usr/sbin and /sbin in my regular user's path. Makes tab
completion with sudo work much more nicely. (And tools like "ip" and
"ifconfig" do have functionality accessible to non-privileged users.)
David
--
David Tomaschik
OpenPGP: 0x5DEA789B
http://systemoverlord.com
david at systemoverlord.com
More information about the Ale
mailing list