Jana Svarova jana.svarova@gmail.com 2014 This page explains how to prevent users from changing disks partition/format. Lock down changing disks settings

PolicyKit enables you to set permissions for individual operations. For udisks2, the utility for disk management services, the configuration is located at /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy. This file contains a set of actions and default values, which can be overridden by the system administrator.

To prevent users from changing disks settings:

Create a file with the same content as in /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy.

cp /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy /etc/share/polkit-1/actions/org.freedesktop.udisks2.policy

Do not change the /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy file, your changes will be overwritten by the next package update.

Delete the action you do not need and add the following lines to the /etc/polkit-1/actions/org.freedesktop.udisks2.policy file:

Modify the disks settings Authentication is required to modify the disks settings no no yes ]]>

Replace no vy auth_admin if you want to ensure only the root user is able to carry out the action.

Save the changes.

When the user tries to change the disks settings, the following message is returned:

Authentication is required to modify the disks settings