I noticed and enjoy that both sudo and doas use each side of a standard qwerty keyboard to type, though doas uses 3 keys on the left while sudo has two on the left and two on the right. It made the transition a little easier for my muscle memory.
On dvorak they're also mostly on the home row (except d), and the split is even 2-2 for both.
(aoeu)id(htns)
The neo2 layout has both in the home row.
I mapped ^S in zsh to toggle "doas" at the start of the line:
# Toggle "doas" at the start.
toggle-doas() {
[[ "${BUFFER:0:4}" = "doas" ]] &&
{CURSOR+=-5; BUFFER="${BUFFER:5}";} ||
{BUFFER="doas $BUFFER"; CURSOR+=5;}
}
zle -N toggle-doas toggle-doas && bindkey '^s' toggle-doas
Even less typing!
Re:Sudo Replacement
by mcarmichael on Saturday January 21, 2023 @12:27AM
(#34464142)
The primary author, Ted Unangst, has a couple of blog posts describing the inception of doas, and its intended typical use patterns:
Re:Sudo Replacement
by StreamBright on Saturday January 21, 2023 @05:23AM
(#34465380)
I have moved over to doas a while back and it is really amazing. Why? Because it JUST WORKS. I do not need to learn a configuration language to understand what is going on. It does very little and that is exactly what 80% of the users need. We should use more software like that. Simplicity is the best design pattern.
Re:Sudo Replacement
by MobiusHorizons on Saturday January 21, 2023 @11:43AM
(#34467661)
When you find software that has a clean abstraction it really is a beautiful thing. sndiod (also from the BSDs) is also amazingly simple and reliable.
My existence is split between OpenBSD and Linux. What I really want is OpenBSD than runs Steam and Proton—nothing more.
OpenBSD has maintained exceptionally good taste when it comes to change. When they rip out and replace a "classic" utility, they invariably make a modern classic: openssh, pf, doas
When others rip out a system and replace wholesale, they often just do the hard work to secure the existing thing: Wayland vs. Xenocara
I don't know that there's any objective way to know ahead of time whether replacement or repair is the right approach. But the fact that such a relatively small project such as OpenBSD has managed such outsized positive impact across the open source landscape speaks volumes to their intuitions here.
1: https://man.openbsd.org/doas