The officially official Devuan Forum!

You are not logged in.

#1 2022-09-02 14:07:42

Excalibur
Member
Registered: 2019-03-07
Posts: 15  

Replacing sudo.

OpenBSD has replaced sudo from its default install with doas. This utility is available in Devuan's package repositories. Once installed you create an /etc/doas.conf file with the needed commands you wish to run as root. An example is given below:-

                permit nopass username as root cmd /sbin/shutdown

To run the command just type, doas /sbin/shutdown -r now.

Further examples can be found at the bottom of the doas.conf man page.

So, to install doas do the following: aptitude purge sudo ; aptitude install doas      (use your preferred package manager)

There may be a caveat in using doas, some heavyweight desktop environments may have a dependency on sudo, so check this out before you try doas. I think you will find doas has a cleaner syntax than sudo and I have found it to be more flexible for my needs.

Offline

#2 2022-09-02 17:06:59

Camtaf
Member
Registered: 2019-11-19
Posts: 213  

Re: Replacing sudo.

It was introduced because a lot of admins had problems configuring sudo properly, & it has a lot less options, which makes it easier.

They introduced doas just after I finally got around to buying Sudo Mastery, just my luck. big_smile

Online

#3 2022-09-02 17:15:53

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,530  

Re: Replacing sudo.

The creator of doas explains their reasons here:

https://flak.tedunangst.com/post/doas

Offline

#4 2022-09-03 16:03:09

chris2be8
Member
Registered: 2018-08-11
Posts: 155  

Re: Replacing sudo.

Excalibur wrote:

So, to install doas do the following: aptitude purge sudo ; aptitude install doas      (use your preferred package manager)

Or better:
aptitude install doas
Check doas works and does everything you need!
aptitude purge sudo
Now check if everything still works. Eg does the menu option to shut down the system need sudo?

I've spend too many years installing software to risk cutting myself off.

Offline

#5 2022-09-03 18:42:05

brocashelm
Member
Registered: 2020-06-29
Posts: 96  

Re: Replacing sudo.

Head_on_a_Stick wrote:

The creator of doas explains their reasons here:

https://flak.tedunangst.com/post/doas

I've been listening to some of Ted Unangst's talks. He's very thorough about his approach to improving code.

Anyway, I've been playing around with doas and actively considering installing OpenBSD on the side. I like the more minimalist, no-hands-held environment.

Last edited by brocashelm (2022-09-03 18:42:26)


"Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety." - Benjamin Franklin

"In a time of universal deceit, telling the truth is a revolutionary act." - George Orwell

Offline

#6 2022-09-04 09:40:27

Camtaf
Member
Registered: 2019-11-19
Posts: 213  

Re: Replacing sudo.

As far as regular desktop users, & small networks go, doas would be a better option for most distros.

Online

#7 2022-09-04 12:45:33

delgado
Member
Registered: 2022-07-14
Posts: 26  

Re: Replacing sudo.

Hm, how would the following look in doas style?
(Capt. Obviuos does not want to compile as root)

$ ./configure
$ make
$ sudo make install

Offline

#8 2022-09-04 14:26:51

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,530  

Re: Replacing sudo.

^

./configure
make
doas make install

Or add this to your shell initialisation file (eg, ~/.bashrc):

alias sudo='/usr/bin/doas'

Then just carry on using sudo as you always have done.

Offline

Board footer