Bugzilla – Bug 909
"sudo" without any arguments should just work
Last modified: 2019-11-21 11:30:43 MST
I frequently see customers using "sudo su", "sudo bash", or variants thereof which always makes me twitch slightly. Presumably, this is because they don't know about "sudo -i", and running "sudo" without any arguments doesn't work (but prints the help text). Couldn't plain "sudo" just work and open a root shell? Similarly, "sudo -u postgres" could just open a shell for that user. I think this would make sudo adoption in the field easier.
Fwiw, I don't care much if "sudo" gives a login or a normal shell. The point is that the command should do something reasonable.
Sudo already supports this when shell_noargs is set in sudoers. E.g. Defaults shell_noargs That will make "sudo" behave like "sudo -s".
Is there a reason why this isn't in the default configuration? UX items like that are mostly only useful if people can rely on them by default and don't have to configure every system first.