Chris Adams wrote:
> Once upon a time, Tim <ignored_mail...@yahoo.com.au> said:
>> Bob Marčan:
>>> BTW, it's "sudo -i"
>> 
>> No, it's not.  When I said I typed "su -" I meant that I typed "su -".
>> 
>> I'm not sudo-ing when I'm doing a plethora of things, I've become root
>> with the "su" command, and using "su -" with the added dash I'm in
>> their environment, too.
> 
> Which is what "sudo -i" does, without the superfluous "su -".  And you
> can use "sudo -s" instead of "sudo su" too.
> 
> I don't know where the idea that you need to run a second super-user
> tool from the first super-user tool came from.

I'm pretty sure Tim isn't running "sudo su -" but simply
using "su -".

That said, there are configs and/or sudo releases where
"sudo -i" did or does not clean the environment as well as
is needed.  This seems to have been resolved in later
versions of sudo (whether in the code or the default
configurations, I don't know nor am I curious enough to poke
more at the moment).

But on some long-unsupported releases of CentOS, I have
"__git_ps1()" in my PS1 and using "sudo -i" leaves that in
place, resulting in an error each time the prompt is
displayed:

    -bash: __git_ps1: command not found

That made "sudo su -" more appealing in at least one case
that I cared about.

I generally agree that the combination isn't needed in most
cases.  But there are exceptions (or at least there were,
for long enough that habits and muscle memory comes into
play). :)

Despite more modern CentOS Stream/RHEL/Rocky/etc having PS1
and PS2 in the env_keep list (while Fedora removed it per
rhbz#1676925 in 2019¹), they no longer pass along my PS1
with "__git_ps1()" in it.  Since that's not something I
really want to happen, I haven't dug into exactly why.

¹ https://bugzilla.redhat.com/1676925

-- 
Todd

Attachment: signature.asc
Description: PGP signature

-- 
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to