Bug 909 - "sudo" without any arguments should just work
"sudo" without any arguments should just work
Status: ASSIGNED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.29
PC Linux
: low enhancement
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-19 06:48 MST by Christoph Berg
Modified: 2019-11-21 11:30 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.