1

I installed Doas as a replacement for sudo on my Gentoo machine. I followed the documentation here and my /etc/doas.conf looks like this:

permit persist :wheel

I have also restarted the system. However, it still asks me for the password every time I use doas. What am I doing wrong?

cigien
  • 57,834
  • 11
  • 73
  • 112
Colson Xu
  • 35
  • 1
  • 7
  • 4
    Please don't vandalize your posts. By posting on the Stack Exchange network, you've granted a non-revocable right, under the [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/), for Stack Exchange to distribute that content (i.e. regardless of your future choices). By Stack Exchange policy, the non-vandalized version of the post is the one which is distributed, and thus, any vandalism will be reverted. If you want to know more about deleting a post please see: [How does deleting work?](/help/what-to-do-instead-of-deleting-question) – cigien Oct 24 '21 at 22:37

3 Answers3

4

You have to enable persist while you are compiling. Set persist use flag and it will work. If you have (persist) while you are compiling, you have to unmask the app-admin/doas first.

DChaovII
  • 41
  • 1
1

Make below changes in the doas configuration.

permit nopass ::wheel

or allow user and dont require a password to execute commands as root

permit nopass keepenv :username2

Reference URL

https://forums.freebsd.org/threads/doas-tips-sudo-alternative.69409/

mahendra rathod
  • 1,438
  • 2
  • 15
  • 23
1

This works for me:

permit persist username as root

jyand
  • 41
  • 2