200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > ubuntu桌面按钮不能关机/重启 跳转到登录界面的解决方案 ZZZ

ubuntu桌面按钮不能关机/重启 跳转到登录界面的解决方案 ZZZ

时间:2020-09-07 08:57:35

相关推荐

ubuntu桌面按钮不能关机/重启 跳转到登录界面的解决方案 ZZZ

After installing Debian on a laptop this week, once again, I ran into the “problem” of not being able to shutdown or reboot the computer, when another user is logged in, for example via SSH. If you’re a Linux user, maybe you have seen it:

System policy prevents restarting the system when other users are logged in

The cause of this behaviour is something calledpolicykit, and a policy defined in/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy. Ion the web, that suggested to modify this file to change the policy. However, as this file is shipped by a package, and living below/usr/share, it is not intended to be modified by users to override the policies it contains.

The correct way to fix the problem is in something calledPolicyKit Local Authority, or. To enable all users to shutdown or reboot the computer, even when other users are logged in, create a file named/etc/polkit-1/localauthority/50-local.d/usershutdown.pkla(the namemustend in .pkla) and put the following in it:

[Allow Shutdown]

Identity=unix-user:*

Action=org.freedesktop.consolekit.system.stop-multiple-users

ResultAny=yes

ResultInactive=yes

ResultActive=yes

[Allow Restart]

Identity=unix-user:*

Action=org.freedesktop.consolekit.system.restart-multiple-users

ResultAny=yes

ResultInactive=yes

ResultActive=yes

You may have to reboot the computer (or at least log out and back in) for the policy override to take effect.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。