Bug 909

Summary: "sudo" without any arguments should just work
Product: Sudo Reporter: Christoph Berg <myon>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: ASSIGNED ---    
Severity: enhancement    
Priority: low    
Version: 1.8.29   
Hardware: PC   
OS: Linux   

Description Christoph Berg 2019-11-19 06:48:44 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.
Comment 1 Christoph Berg 2019-11-19 06:51:50 MST
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.
Comment 2 Todd C. Miller 2019-11-19 09:15:21 MST
Sudo already supports this when shell_noargs is set in sudoers.  E.g.

Defaults shell_noargs

That will make "sudo" behave like "sudo -s".
Comment 3 Christoph Berg 2019-11-21 11:30:43 MST
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.