Duncaen / OpenDoas

A portable fork of the OpenBSD `doas` command
Other
611 stars 35 forks source link

`question:` How to run nobody under root ? #104

Closed ghost closed 1 year ago

ghost commented 1 year ago

How can I build packages under root, as nobody ?

#[/home/mpk]# doas -u nobody makepkg
doas: Operation not permitted

Makepkg usually has restrictions, even when I run it under a user

$[~]$ doas -u nobody makepkg
==> ERROR: You do not have write permission for the directory $BUILDDIR (/tmp/makepkg).
    Aborting...

Works on sudo perfectly btw

Duncaen commented 1 year ago

You have to configure rules for that.

Either allow root to run things as any user:

permit root

or allow root to use a specific target user:

permit root as nobody
ghost commented 1 year ago

Tqvm permit root in config, then chown -R nobody /tmp/makepkg fixed it.