a POSIX shell script replacement for sudoedit using doas
Go to file
Joel Beckmeyer 547cea05e1 convert echo to printf 2021-12-01 13:45:56 -05:00
LICENSE Initial commit 2021-01-30 17:27:42 -05:00
README.md minor word nitpicking 2021-11-30 10:46:06 -05:00
doasedit convert echo to printf 2021-12-01 13:45:56 -05:00

README.md

doasedit

a POSIX shell script replacement for sudoedit using doas. Inspired by this Reddit comment.

USE AT YOUR OWN RISK! THIS SCRIPT IS VERY ALPHA.

I've already accidentally deleted a configuration file because of a hole in the script. That hole has obviously been fixed since then, along with the addition of several other safety measures, but do know that this script (and most other scripts like it) is doing something very different from how a file is normally edited in-place. It creates a temporary copy and then overwrites the original file at the end.

doas.conf

You'll want to configure doas such that it doesn't ask for password at every line of the script using doas. You can accomplish this with either nopass or persist, e.g.:

# allow users in group 'admin' to use doas without asking for password 
# (more dangerous)
permit nopass :admin
# allow users in group 'admin' to use doas with password, but not asking for
# some time after first successful authentication
permit persist :admin