Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This reiterates the idea that you should avoid rarely-used features of security-critical software, and is perhaps an argument that those features shouldn't exist in the first place. An extremely-minimal `sudo` alternative would be a nice idea.


There is an alternative: OpenBSD's doas: https://man.openbsd.org/doas

There is a Linux port, too


From what I've understood there are multiple Linux ports and some differ and don't have the persist feature: https://old.reddit.com/r/linux/comments/en1lu1/yesterday_i_l...


I'll have to look into that. Retraining 15 years of muscle memory to not type `sudo` would be hard, but I guess I could make an alias :)


Yep, one of the first things I did after OpenBSD switched was:

  alias sudo='doas'
It's tough to remember to type 'doas' instead of 'sudo', especially when you use both Linux and OpenBSD all the time (which is why I also have a "doas" alias on my Linux hosts!).


Why change the name of the command just to switch to a different implemention? It should be possible to make a drop-in replacement for sufo itself in Rust or your favorite safe language, and a drop-in safe replacement is likely to get much more traction than some completely new thing.


What do you really need other than "mysudo <command to run> <command's args>"?

All of sudo's command line options and config options are part of its complexity.


`sudo -u username` is pretty useful.


Which is one of the few options that doas also supports.


doas is not intended to be a drop in placement for sudo. While the core feature (run a command as another user) is the same, many of the subfeatures are different.


That's my point: instead of telling everyone to switch to doas, which is a major disruption, someonee shold make a drop-in in sudo reimplementation, which can be used without disrupting existing workflows.


Instead if writing a drop-in replacement, which would be a lot of work, the authors wrote a replacement for the workflows they cared about, without nearly as much flexibility or complexity.

A 3rd party rewrite is a great time to assess what features are core features and which are extraneous. I haven't evaluated doas, but I'm definitely in favor of priviledged utilities having less code in general and having less complexity.


Sudo features exist for a reason. People use them. If you delete random features that you don't happen to use, the people who use sudo today won't switch to your new tool. It doesn't matter that in your opinion those missing features are unnecessary. You don't get to make the call.

If your goal is to eliminate unsafe C code from critical paths, you want a drop-in sudo replacement. If your goal is to just be opinionated, sure, make a non-sudo thing with a selection of features you personally consider important --- but don't be surprised if people keep using sudo.


Because sudo's full behavior is infamously complex. You might be able to make it better with a rewrite, but you're talking about a massive effort with significant risk, and all to reproduce a system that really should be redesigned to be easier to secure in the first place (hence doas).


How about BSD's `doas`[0]?

[0]: http://man.openbsd.org/doas


Specifically, OpenBSD's. To give credit where it is due.


OpenBSD replaced `sudo` with `doas` in 2015. Both are currently maintained by OpenBSD developers but `sudo` isn't part of OpenBSD.

See https://www.openbsd.org/innovations.html and OpenBSD src commit dated Fri Jul 3 21:51:53 2015 +0000.


I wrote "root" as a simpler sudo some years ago.

https://github.com/mikelward/root




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: