On Sun, 2023-10-29 at 04:06 -0700, ToddAndMargo via users wrote:
On 10/29/23 04:02, Patrick O'Callaghan wrote:
> On Sat, 2023-10-28 at 15:56 -0700, ToddAndMargo via users wrote:
> > > > $ doas -u root "nvme smart-log /dev/nvme0n1"
> > > > doas: Operation not permitted
> > >
> > > Try removing the quotes.
> > >
> > > poc
> >
> > $ doas -u root nvme smart-log /dev/nvme0n1
> > doas: Operation not permitted
>
> Does doas ask for your password (you as a user, not root)?
>
> What happens when you use sudo (or 'su -c' - note that in this case
> you'll need the quotes)?
>
> What happens if use:
> doas nvme ...
> i.e. without the '-u root' (since root is the default).
>
> poc
I am trying to get the information without having
to be root. And it does not have to come from the
nvme command either.
My goal is to do a libnotify popup when I log
into my desktop
If the nvme command requires root, it requires root (presumably because
of the direct access to the device).
The point of 'doas' or 'su' or 'sudo' is to get root temporarily
for
the duration of the command. The question here is why is it failing,
and the answer is most likely "because you're doing it wrong". That's
why I'm asking what happens when you run those various alternatives. My
guess is that you have to enable your user via the doas.conf(5) config
file.
I can run doas without issue and have never edited doas.conf. However I
am a member the 'wheel' group, which the default doas.conf does enable:
$ cat /etc/doas.conf
# Allow wheel by default
permit :wheel
So I suggest you try as a member of the wheel group and see what
happens.
poc