cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Commander Commander
Commander
  • 139 Views

sudo su vs sudu -i

What's the difference between:

              sudo -i

                  vs

              sudo su

 

 

 

Trevor "Red Hat Evangelist" Chandler
1 Reply
Blue_bird
Starfighter Starfighter
Starfighter
  • 107 Views

Ofcorse... both commands are used to obtain a root shell (become the superuser), they achieve it in slightly different ways.


sudo -i (Recommended): Simulates a fresh login as the root user. It cleans up the environment variables and loads the root user's specific configuration files (.profile, .bash_profile, etc.).

sudo su: Runs the su (switch user) command using sudo privileges. It often creates a "mixed" environment where you are root, but some variables (like your shell settings) might still belong to your original user.

Thanks

0 Kudos
Join the discussion
You must log in to join this conversation.