6

I am running Debian GNU/Linux (Bookworm) and by using the gnome-disk-utility 45.1 (UDisks 2.10.1) I like to put a spinning disk immediately to stand-by (via GUI). Doing so I'm being prompted for a password. — BTW: I'm not looking for a command line way for doing this.

Nevertheless, I am wondering why it is possible to format a disk (a.k.a. initializing a disk with new MBR or GUID partition scheme) without providing a password?! This can lead to accidental data loss, IMHO.

I am asking this question because I'd like to put my disks into stand-by without being prompted for a password. How could I possibly achieve that?

BTW: My non-root user is member of the following groups: redacteduser adm cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin scanner systemd-journal

0

1 Answer 1

8

The policy of when UDisks-based disk utilities ask for a password and when they don't is determined by the /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy file by default.

Because that file contains a lot of language translations, it might be easier to get an overall understanding of the different actions and their default security policies with a command like:

grep -v xml:lang /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy |less

Basically, UDisks2 requires more strict authentication on devices that are considered "system devices", devices assigned to a seat other than the one you're currently using (applicable on multi-seat system configurations or remote access), or marked with a x-udisks-auth option in /etc/fstab.

If you want to change the default rules, you can write your own customizations in /etc/polkit-1/rules.d/. If you need help in that, search for questions that mention polkit.addRule here in the Unix&Linux StackExchange: there are a plenty of examples already written.

It sounds like you might want to write yourself a custom rule that will allow you to perform the actions:

  • org.freedesktop.udisks2.ata-standby,
  • org.freedesktop.udisks2.ata-standby-system,
  • org.freedesktop.udisks2.power-off-drive and/or maybe
  • org.freedesktop.udisks2.power-off-drive-system

without an authentication check, and perhaps make the rules on org.freedesktop.udisks2.modify-device (controls filesystem creation, partitioning, filesystem labelling, etc.) a bit stricter than default.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .