Jana Svarova
jana.svarova@gmail.com 2014
Ekaterina Gerasimova
kittykat3756@gmail.com 2014
Evitar que os usuarios cambiar as particións do disco.
Fran Diéguez
frandieguez@gnome.org 2010-2025

# Desactivar o reparticionado

polkit 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 system administrator.

The polkit configuration in /etc overrides that shipped by packages in /usr/share.

# Desactivar o reparticionado

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

Non cambie o ficheiro /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy, os seus cambios serán sobreescritos pola seguinte actualización do paquete.

Delete any actions you do not need from within the `policyconfig` element and add the following lines to the /etc/polkit-1/actions/org.freedesktop.udisks2.policy file:

<action id="org.freedesktop.udisks2.modify-device"> <description>Modify the drive settings</description> <message>Authentication is required to modify drive settings</message> <defaults> <allow_any>no</allow_any> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults> </action>

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

Gardar os cambios.

When the user tries to change the disk settings, the following message is shown: Authentication is required to modify drive settings.