You are not logged in.
Hi
I try to use fdisk - l for users without root or sudo
Then add fdisk -l to sudoers.
and add the user to the disk & storage group
but have no permission to access the nvme disk:
fdisk: cannot open /dev/nvme0n1: Permission denied
Need to change udev to add nvme disk to disk group?
This related to
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk" in 50-udev-default.rules ?
Last edited by maziar (2023-10-01 09:47:44)
Offline
What is the current ownership and permissions of /dev/nvme0n1? Why add fdisk -l to sudoers if you run it without sudo? What is the output of the following:
ls -la /dev/nvme0n1
sudo -u nobody -g disk parted -lOffline
ls -la /dev/nvme0n1:
brw-rw---- 1 root disk 259, 1 Sep 30 11:53 /dev/nvme0n1
sudo -u nobody -g disk parted -l:
Sorry, user zz is not allowed to execute '/usr/bin/parted -l' as nobody:disk on r4b.
Offline
The sudo command needs to be run by a user that can execute arbitrary commands as other users such as root or if you had used one of the first three examples from Sudo#Example_entries.
What groups is your user currently in?
groupsOffline
user:
root sys wheel disk kvm storage users rfkill i2c libvirt zz
Last edited by maziar (2023-09-30 16:04:40)
Offline
So your user is in the "disk" group and should™ not require sudo to read the nvme device?
Post the complete, unedited, output of
LC_ALL=C sudo -l
LC_ALL=C fdisk -l /dev/nvme0n1Offline
yes was set group & sudoers for the user don't require sudo :
(root) /usr/bin/fdisk -l
(root) NOEXEC: NOPASSWD: /sbin/dmidecode, /sbin/lsof, /usr/bin/fdisk -l, /usr/sbin/dmsetup ls,
/usr/sbin/dmsetup table*, /usr/sbin/multipath -ll, /usr/sbin/iscsiadm list *, /usr/sbin/fcinfo
(ALL) ALL
fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1:*****
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
I don't understand why but today the problem was fixed!
Last edited by maziar (2023-10-01 09:49:18)
Offline