You are not logged in.

#1 2015-01-09 09:58:18

IlikePepsi
Member
Registered: 2013-10-29
Posts: 10

Mounting HDD still requires root permission [SOLVED]

Hi all,

I'm using ArchLinux on an external harddrive so I can work machine independant. From time to time I need to mount some of the internal harddrives but I didn't want to create a fstab entry for every possible drive. So I added my user to a group that is allowed to use mount and umount without permission (via visudo).

%users ALL=NOPASSWD: /usr/bin/mount
%users ALL=NOPASSWD: /usr/bin/umount

The drives are owned by group disk where my user was also added to get r/w permission. And I created a mountpoint directory in /home/<username> to avoid struggle with the file systems access rights.

When trying to mount a drive with

mount /dev/sda2 ~/mnt

the system keeps telling me that only root can do that.

When using sudo it works. What did I miss?

Thanks in advance.

Last edited by IlikePepsi (2015-01-09 11:14:46)

Offline

#2 2015-01-09 10:15:03

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Mounting HDD still requires root permission [SOLVED]

Isn't that the expected behavior?

Offline

#3 2015-01-09 10:17:21

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,721
Website

Re: Mounting HDD still requires root permission [SOLVED]

So I added my user to a group that is allowed to use mount and umount without permission

No, you didn't. You gave that group permission to run those two commands without entering a password when running them with sudo. It doesn't change the permissions/functionality of the binaries in question.

What did I miss?

I think you probably missed this: https://wiki.archlinux.org/index.php/Udisks

Last edited by WorMzy (2015-01-09 10:17:47)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2015-01-09 11:12:23

IlikePepsi
Member
Registered: 2013-10-29
Posts: 10

Re: Mounting HDD still requires root permission [SOLVED]

WorMzy wrote:
IlikePepsi wrote:

So I added my user to a group that is allowed to use mount and umount without permission

No, you didn't. You gave that group permission to run those two commands without entering a password when running them with sudo. It doesn't change the permissions/functionality of the binaries in question.

Ah ok, that's what I got wrong. I thought I could use mount without the prepending sudo after the modifications. Thanks for pointing that out.

Offline

Board footer

Powered by FluxBB