How to install and replace sudo with doas?

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

How to install and replace sudo with doas?

Post by /RaspberryPi »


I have a RaspberryPi Zero 2 W that I am using as a testing unit to learn a bit more about Linux. In a quest to make the OS a bit more "minimal", I am trying to replace sudo with doas as it is supposed to be much smaller and have all the utilities a common user would ever need. I started by running the command sudo apt install doas -y and then navigated to /etc/doas.confg which was an empty file. I added:

permit persist as root permit persist :wheel as root

In the ~/.bashrc, I added the line: `alias sudo='doas' to allow me to run doas without giving a second thought about sudo.

Now I can run simple commands like doas apt update and everything works fine. I now uninstalled sudo (had to go into root and enable an environment where sudo removal was possible and then ran the command apt remove sudo).

Now, I can still run doas apt update and stuff, but can't seem to navigate through the system? I cannot for instance run the command doas cd /root as it gives the error cd command not found. How do I fix this, or where did I go wrong?
submitted by /u/montythemink
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... with_doas/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”