Show Table of Contents
13.7. パーティション再設定のロック
polkit により、個別操作の権限を設定できます。ディスク管理サービスのユーティリティーである udisks2 の場合、設定は /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy にあります。このファイルには、システム管理者が上書きできる操作およびデフォルト値のセットが含まれます。
重要
/etc に保存される polkit 設定が /usr/share/ のパッケージで提供される設定内容を上書きすることに注意してください。
手順13.7 ユーザーによるディスク設定の変更を回避する
/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
/usr/share/polkit-1/actions/org.freedesktop.udisks2.policyファイルは変更しないようにしてください。変更を加えても、次のパッケージの更新で上書きされます。- 不要な操作を削除し、以下の行を
/etc/polkit-1/actions/org.freedesktop.udisks2.policyファイルに追加します。<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>root ユーザーのみがこの操作を実行できるようにする必要がある場合は、noをauth_adminに置き換えます。 - 変更を保存します。
ユーザーがディスク設定を変更しようとする場合、以下のメッセージが返されます。
Authentication is required to modify the disks settings

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.