I want to run a command in the background as root. And I have a problem with doas command.
With sudo, I can use sudo --background <command>
. It will ask for password, then runs in the background. I cannot do doas <command> &
because it will ask for the password in the background and stuck there forever.
I've checked the manpage but did not find the equivalent option for doas.
doas
have the equivalent ofsudo -v
(basically just prompt for authentication to cache credentials for a while)? Then you could authenticate once, then rundoas <command> &
and it would use the cached credentials. If it doesn't, you can still try something likedoas true; doas <command> &