Suchen

Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

13.7. Locking Repartitioning

download PDF
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.

Important

Remember that polkit configuration stored in /etc overrides the configuration shipped by packages in /usr/share/.

Procedure 13.7. To Prevent Users from Changing Disks Settings

  1. 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.
  2. Delete the action you do not need and add the following lines to the /etc/polkit-1/actions/org.freedesktop.udisks2.policy file:
      <action id="org.freedesktop.udisks2.modify-device">
         <message>Authentication is required to modify the disks 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.
  3. 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
Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.