reboot/shutdownコマンド実行するには 管理者権限 が必要で、sudoとかで指定ユーザ、指定グループに許可を出すことができる

っが、GUI画面ではメニューにrebootやらshutdownが表示されて容易に実行できてしまう
それを抑制したくて polkit を適用してみた.

[root@rockylinux9 ~]# vi /etc/polkit-1/localauthority/50-local.d/50-disallow-power-related-rurles.pkla
 
[Require authentication for shutdown]
Identity=unix-user:*
Action=org.freedesktop.login1.power-off*;org.freedesktop.login1.reboot*;org.freedesktop.login1.suspend*;org.freedesktop.login1.hibernate*;org.freedesktop.login1.set-reboot*
ResultAny=auth_admin
ResultInactive=auth_admin
ResultActive=auth_admin
 
[root@rockylinux9 ~]#

「Action」は「/usr/share/polkit-1/actions」に記載されている

[root@rockylinux9 ~]# systemctl stop polkit.service
 
[root@rockylinux9 ~]# systemctl start polkit.service
最新の60件
2025-02-17 2025-02-15 2025-02-14 2025-02-12 2025-02-03 2025-02-02 2025-02-01 2025-01-27 2025-01-26 2025-01-25 2025-01-24 2025-01-23 2025-01-20 2025-01-13
  • polkit
2025-01-12 2025-01-08 2024-12-30 2024-12-29 2024-12-22 2024-12-20 2024-12-17 2024-12-15 2024-12-14 2024-12-12 2024-12-11 2024-12-10 2024-12-09 2024-12-08 2024-11-28 2024-11-22 2024-11-15 2024-11-14 2024-11-12 2024-11-06 2024-11-05 2024-11-04 2024-11-02 2024-11-01 2024-10-28 2024-10-27 2024-10-23 2024-10-18 2024-10-17 2024-10-15 2024-10-14

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2025-01-13 (月) 04:05:23