View previous topic :: View next topic |
Author |
Message |
urcindalo l33t
Joined: 08 Feb 2005 Posts: 623 Location: Almeria, Spain
|
Posted: Fri Jan 15, 2021 12:19 pm Post subject: How to mount an internal drive in Plasma with no password? |
|
|
Hi and thanks for reading this!
I just installed an extra SATA drive on my box, where I'm going to backup all my photos. So, I don't want it to mount at every boot up, but only when I need it under my Plasma session.
However, every time I want to mount it (by clicking on its icon in the left side panel of a Dolphin's window), I'm asked for the root password, which is very annoying.
What can I do to just mount my internal SATA drive without being asked for a password? I guess I need to configure some rule somewhere, but I haven't been able to find the solution. Any help is appreciated. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Fri Jan 15, 2021 12:31 pm Post subject: |
|
|
Hi
Please create a file
/etc/polkit-1/rules.d/30-mount-drive.rules
Code: |
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
action.id == "org.freedesktop.udisks2.filesystem-mount") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
|
Then please run
Code: |
usermod -aG wheel $USER
|
OR
you may try to add the user in the group "disk"
Code: |
usermod -aG disk $USER
|
_________________
|
|
Back to top |
|
|
Buffoon Veteran
Joined: 17 Jun 2015 Posts: 1369 Location: EU or US
|
Posted: Fri Jan 15, 2021 1:00 pm Post subject: |
|
|
Bad advice. Very bad advice. User rights should not be elevated to perform such a task. In particular disk group is way over the line. It gives access to the raw devices, effectively giving root rights.
In past it was sufficient to set mount rights in fstab, does Plasma not honor settings in fstab? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Fri Jan 15, 2021 2:00 pm Post subject: |
|
|
@Buffoon
He wants to mount it via dolphin not fstab.
So if dolphin/kde dont take care of perms then someone should..
As he expressed his unwillingness to having had to enter passwd all the time.
GRANTED though the disk group thing is a little overkill and a bad advice.
_________________
Last edited by alamahant on Fri Jan 15, 2021 5:49 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21602
|
Posted: Fri Jan 15, 2021 4:58 pm Post subject: |
|
|
The traditional way to do this would be to tell fstab that any user may mount the device. I cannot say whether this will be sufficient to get Plasma not to ask for a root password. |
|
Back to top |
|
|
urcindalo l33t
Joined: 08 Feb 2005 Posts: 623 Location: Almeria, Spain
|
Posted: Fri Jan 15, 2021 5:43 pm Post subject: |
|
|
alamahant wrote: | @Buffoon
He wants to mount it via dolphin not fstab.
So if dolphin/kde dont take care of perms then someone should..
As he expressed his unwillingness to having had to enter passwd all the time.
GRANTED though the disk group thing is a little overkill and a bad advice.
|
Thanks very much for your help, @alamahant
Your indication made the trick. I was already in the wheel group so I just needed the rule. |
|
Back to top |
|
|
|