Ubuntu Mate Desktop 暂停后不要求输入密码

guy*_*oni 5 suspend ubuntu-mate 20.04

我为这个问题苦苦挣扎了几天。

我安装了 Ubuntu 20.04,并安装了ubuntu-mate-desktop. 当我暂停系统时,恢复时它不会要求输入密码。

有什么方法可以设置它以便恢复系统时会弹出密码窗口吗?

guy*_*oni 3

我发现这个解决方案对我有用。

\n

首先,以 root 身份创建文件/etc/systemd/system/lock.service

\n
[Unit]\nDescription="Make extra sure to lock the screen when suspending"\n\n[Service]\nType=oneshot\nUser=root\nExecStart=/bin/loginctl lock-sessions\n\n[Install]\nWantedBy=suspend.target\n
Run Code Online (Sandbox Code Playgroud)\n

然后,为了更新系统配置,在控制台中键入 \xe2\x80\x8b:

\n
sudo systemctl daemon-reload\nsudo systemctl enable lock.service\n
Run Code Online (Sandbox Code Playgroud)\n