Ubuntu Shutdown while other user logged on

1. sudo vim /etc/systemd/logind.conf

修改代码KillUserProcesses=yes

Ubuntu Shutdown while other user logged on_第1张图片

2. sudo touch /etc/polkit-1/localauthority/50-local.d/multi-user-inhibit-shutdown-restart.pkla

3. 打开修改配置文件

sudo vim /etc/polkit-1/localauthority/50-local.d/multi-user-inhibit-shutdown-restart.pkla

[multi-user-inhibit-shutdown-restart]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off-multiple-sessions;
ResultActive=auth_admin

Ubuntu Shutdown while other user logged on_第2张图片

4. reboot

你可能感兴趣的:(ubuntu,linux,运维)