On Wed, Mar 26, 2025 at 12:23:38 +0100, to...@tuxteam.de wrote:
> On Wed, Mar 26, 2025 at 02:15:03PM +0300, J wrote:
> > And i thought *sudo -i*, you speaking about, is something like
> > *--interactive*, which is not, how i see now...
> 
> The long form is "--login", not interactive. But the "-i" stands
> in for the interactive shell it gives you. Go figure :-)

"sudo -s" gives you a root shell, of the non-login variety.  In the case
of bash, this means it reads ~root/.bashrc but not /etc/profile and
so on.

"sudo -i" gives you a root shell, of the login variety.  In the case of
bash, this means it reads /etc/profile and ~root/.profile (or possibly
~root/.bash_profile or ~root/.bash_login).

I normally use "sudo -s", which is the closest sudo approximation to
the traditional behvior of "su" (before it was broken in buster).

"sudo -i" is meant to approximate the behavior of "su -".  Before buster,
nobody would have used that on a Debian system.  It's horrible.  The
fact that people are now embracing it as a norm is even worse.

Reply via email to