Skip to main content

Questions tagged [doas]

Use this tag with questions regarding the use or configuration of the doas utility, used for executing a command or shell as another user.

Filter by
Sorted by
Tagged with
0 votes
2 answers
65 views

How to check permissions of a non sudoers user with full root access?

doas is a sudo-like command recently packaged in Debian 12, Ubuntu Jammy (universe) and some other Linux distros. A non sudoers user (doasuser) can be added to /etc/doas.conf to be granted root access....
GAD3R's user avatar
  • 67.2k
0 votes
1 answer
48 views

Why isn't this command from this script run by the user specified by doas -u when this script is copied and run by an ansible playbook?

I wrote a simple playbook, open-links.yml, that is meant to run a script on one of my remote hosts: - name: Run Bash script hosts: myhosts gather_facts: false vars: au: "j" tasks:...
John Smith's user avatar
0 votes
1 answer
507 views

How to run a command in the background with 'doas'?

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....
Livy's user avatar
  • 455
2 votes
1 answer
233 views

Why doesn't this script succeed from crontab as it does when manually run?

This script works when executed with doas ./backup_cron_root.sh #!/usr/bin/bash /usr/bin/crontab -l> "/tmp/cron.$(whoami).$(hostname)" && /bin/date>>"/tmp/cron.$(...
John Smith's user avatar
1 vote
0 answers
75 views

Why doesn't doas wget -qO- archive.tar.gz|doas tar -xz work as with sudo?

sudo wget -qO- https://go.dev/dl/go1.20.1.linux-amd64.tar.gz|sudo tar -xz works fine. doas wget -qO- https://go.dev/dl/go1.20.1.linux-amd64.tar.gz|doas tar -xz does not work. I get no input, it just ...
John Smith's user avatar
1 vote
1 answer
368 views

How to install packages in chroot when chroot is launched with doas?

On OpenBSD 7.2 stable, I've setup my chroot using this script: #!/bin/ksh dir="/jails/$1" mkdir -p "$dir" tar -C "$dir" -xzf /usr/src/base/base72.tgz tar -C "$dir&...
neezer's user avatar
  • 31
0 votes
0 answers
217 views

How to make doas ask for root password

I want to configure doas so that it asks for root password, but not for normal user password. How do I do that?
PuuRaidur's user avatar
0 votes
0 answers
601 views

doas doesn't run a /usr/sbin binary

I'm using Debian/GNU/Linux Unstable, and I was trying doas for the first time today, with the following simple config file: $ doas cat /etc/doas.conf permit persist alx as root While it worked for ...
alx - recommends codidact's user avatar
-1 votes
1 answer
875 views

Using "doas" with root password instead of user password

From my limited understanding, the doas utility allows you to run any command as root but, by default, requires you to enter your own password instead of the root user's password. How do I make it ...
NickKeeger's user avatar
-3 votes
2 answers
107 views

Is there any way to prevent someone from running a shell as root?

This is a question I've pondered for a long time and thought was impossible. Is it possible to prevent administrators of a machine from bypassing the audit capabilities of sudo or doas? For instance, ...
Brian's user avatar
  • 1
0 votes
1 answer
555 views

Changing "doas" prompt

How may I change my doas prompt? For example, to change sudo prompt you just run export SUDO_PROMPT="Prompt: " Is there an equivalent for doas?
maDeveloper's user avatar
1 vote
1 answer
4k views

shutdown without password using doas

I want to be able to shutdown (or restart) my system without having to enter my password. My /etc/doas.conf looks like this and my user is in the wheel group permit nopass :wheel as root cmd /sbin/...
danielspaniol's user avatar
2 votes
1 answer
6k views

"doas" allow user to run command with other user and set environment variables

There are two normal users on my OpenBSD machine ("user" and "TESTUSER") and I have this doas config: # cat /etc/doas.conf ...
Hessnov's user avatar
  • 591
2 votes
2 answers
1k views

Why would root need to run unrestricted commands as itself via doas?

I've just come across doas, and while reading the man page for its configuration I found this example: The following example permits users in group wsrc to build ports; wheel to execute commands as ...
ian's user avatar
  • 169