描述
- OS: Debian/Linux testing bookworm
- Kernel: x86_64 Linux 5.15.0-3-amd64
- 系统要睡眠(Sleep)或休眠(Hibernate)时弹出授权对话框,要求输入密码。
解决
将当前用户加到users
群中:
$ sudo usermod -aG users "$USER"
查看 PolKit版本
$ pkaction --version
pkaction version 0.105
增加规则文件:/var/lib/polkit-1/localauthority/50-local.d/50-enable-suspend-on-lockscreen.pkla
[Allow suspending in lockscreen]
Identity=unix-group:users
Action=org.freedesktop.login1.suspend
ResultAny=yes
ResultInactive=yes
ResultActive=yes
设置权限:
sudo chmod 644 /var/lib/polkit-1/localauthority/50-local.d/50-enable-suspend-on-lockscreen.pkla