Skip to content

Instantly share code, notes, and snippets.

@NullCode1337
Created March 26, 2025 09:20
Show Gist options
  • Save NullCode1337/8bf4389af500ad266f010fe40f3fe67d to your computer and use it in GitHub Desktop.
Save NullCode1337/8bf4389af500ad266f010fe40f3fe67d to your computer and use it in GitHub Desktop.
Mount disks in GNOME without password
# usermod -aG disk <user>
# vim /etc/polkit-1/rules.d/10-udisks2.rules

ADD THE FOLLOWING

// See the polkit(8) man page for more information
// about configuring polkit.

// Allow udisks2 to mount devices without authentication
// for users in the "wheel" group.
polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
         action.id == "org.freedesktop.udisks2.filesystem-mount") &&
        subject.isInGroup("disk")) {
        return polkit.Result.YES;
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment