What is the difference between sudo -s
and sudo -i
and why do they give me different shells? It appears -s
keeps me within bash
and -i
gives me sh
.
On MacOSX High Sierra 10.13, if I type sudo -s
into a terminal and enter my password, I get root as my username, but with a dollar sign at the prompt:
user1@mymachine:~$ sudo -s
**root@mymachine:~$**
But if I type in sudo -i
, I get:
user1@mymachine:~$ sudo -i
Password:<br/>
**mymachine:~ root#**
Why am I not presented with the hash sign # if I am root in the above example with sudo -s
? Am I not truly root?
Are the environment variables different between the two?