View previous topic :: View next topic |
Author |
Message |
nagmat84 Apprentice
Joined: 27 Mar 2007 Posts: 260
|
Posted: Mon Jun 24, 2024 4:03 pm Post subject: [KDE] Allow (non-admin) users to label removable filesystems |
|
|
Is there any option within KDE to allow (non-admin) users to change the label of a file system on removable media only without granting them further capabilities than that?
My 70th years-old father uses KDE on his laptop since last week. I am looking for an option which allows him to change the filesystem label of USB stick such that they appear by that name in Dolphin and file system dialogs. (Note: In Windows this was possible even with a normal user account.)
I am looking for an KDE-based solution.
The only option I found so far is putting my fathers user account into the wheel group and then let him open KPartitionManager. However, this bears this risk that he accidentally breaks the system drive. I would like to limit his options to labeling removable drives only.
Another option would be to show him the Konsole and limit his sudo capabilities to e2label, fatlabel, exfatlabel, ntfslabel etc. but do not allow /dev/sdaX. However, my father is not familiar with the CLI and each of the labeling commands has a slightly different syntax. Moreover, he won’t be able to first figure out the file system type of the USB drive and then call the associated command. |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 649
|
Posted: Mon Jun 24, 2024 11:57 pm Post subject: |
|
|
Once the stick is inserted the KDE device manager systray pop-up allows a user to "Reformat or Edit with Partition Manager". If you go to sytemsettings5 >> Removable Storage >> Device Actions you can see this and edit the name of it (or duplicate it) and change/set the command so it reads Code: | sudo partitionmanager "--device=%d" |
Now you can limit what can be used after --device= in sudoers, with something similar to Code: | NOPASSWD: /usr/bin/partitionmanager --device=/dev/sd[e-z][1-9] | So in the above example we have limited the users ability to run sudo partitionmanager to only when they supply a --device= switch, and have effectively forbidden them from changing /dev/sda through /dev/sdd.
Whether partitionmanager is "overkill for changing an FS label", well that's an entirely different debate... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|