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
cp /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy /etc/share/polkit-1/actions/org.freedesktop.udisks2.policy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy ファイルは変更しないでください。
変更は次のパッケージの更新によって上書きされます。- 不要なアクションを削除し、以下の行を
/etc/polkit-1/actions/org.freedesktop.udisks2.policy ファイルに追加します
。Copy to Clipboard Copied! Toggle word wrap Toggle overflow root ユーザーのみがこの操作を実行できるようにする必要がある場合は、no
をauth_admin
に置き換えます。 - 変更を保存します。
ユーザーがディスク設定を変更しようとすると、以下のメッセージが返されます。
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Authentication is required to modify the disks settings
Authentication is required to modify the disks settings