6 ms·
Sudo's -i option is able to provide you with a shell in the same state that it'd be if it were a fresh login. I've burned this into my fingers a long time ago.
by mid-kid 4y ago
Sudo's -i option is able to provide you with a shell in the same state that it'd be if it were a fresh login. I've burned this into my fingers a long time ago.
Also, in most configurations you have to specifically whitelist environment variables for them to surivive a "sudo" call.
- sph 4y agoIs there another way of opening a root shell other than "sudo -i"? That's what I've been using for a decade. How do other people do it?
- TheAdamist 4y agosu -l root But that only works if theres a password on root, which is generally seen as ill advised. But was how every distro did it in the olden days before there was a sudo group.
- error503 4y ago`sudo su` is a way.
- doublepg23 4y agoI've always used sudo -s but no clue why.
- yjftsjthsd-h 4y agosudo su - Which also resets your environment and everything.