20 ms·
That's a hyper specific nit you got there, and only referenced once in the middle of the article. However sudo -i, sudo su, and sudo su - are all common ways t
by georgyo 3y ago
That's a hyper specific nit you got there, and only referenced once in the middle of the article.
However sudo -i, sudo su, and sudo su - are all common ways to achieve the desired result, with very subtle differences. Sudo su - is my preferred method because it puts you into a root login shell rather than just a shell with root privileges.
But these are all pretty pandantic to call one way correct, and others incorrect.
- zokier 3y agosudo -i specifically invokes login shell: > Run the shell specified by the target user's password database entry as a login shell. Contrast to -s option: > Run the shell specified by the SHELL environment variable if it is set or the shell specified by the invoking user's password database entry
- viraptor 3y agoIt's not that it's incorrect, it's just unnecessary, same as "sudo sudo". I keep seeing those in various places and when people learn that they trip up in environments where there's no "su" available.