The list of functional differences is too long to write here. I'm sure you can ask some llm to do the google search for you and it will shit out an ungodly amount of differences.
But I'd say roughly they are about:
- how you configure it (sudo has a much more complex and expressive syntax, doas needs many more lines for the same result)
- how it preserves env variables (sudo has more options for that, it excludes some by default while keeping others and can spawn subshells differently with -l -i)
- how it does persisting authorization over some period of time :
doas on OpenBSD caches via a kernel API.
The slicer69 portable doas port has no persist on Linux/FreeBSD - you re-enter your password every invocation.
OpenDoas implements persist via timestamp files, similar to sudo but with fewer tuning options.
The size of the code base and therefore attack surface.
The sudo source code is approximately 160,000 lines of C.
Doas was written for OpenBSD (after the OpenBSD project decided sudo was too large to ship in the system base) with a source code of roughly 500 lines of C.
Obviously those extra lines of code bring features to sudo that doas doesn't have.
save