如何在默认安装的 11.10 及更高版本的登录屏幕上隐藏特定用户?(即使用 Unity Greeter)?
答案1
如果您的系统使用AccountsService
,您不能通过重新配置隐藏欢迎屏幕中的用户,lightdm
因为它遵循AccountsService
。这在中的评论中说得很清楚/etc/lightdm/users.conf
。
你需要做什么而是重新配置AccountsService
。
要隐藏名为的用户XXX
,请创建名为
/var/lib/AccountsService/users/XXX
包含两行:
[User]
SystemAccount=true
如果该文件已经存在,请确保将该SystemAccount=true
行附加到该[User]
部分。
重新加载 AccountsService 后更改生效:
sudo systemctl restart accounts-daemon.service
答案2
目前这种方法不起作用,因为漏洞在 lightdm 中。
在应用此方法之前,请检查错误状态。
以下是您想要做的事情:
首先,备份您的配置。
sudo cp /etc/lightdm/users.conf /etc/lightdm/users.conf.bak
然后,您需要编辑您的配置:
sudo nano /etc/lightdm/users.conf
你会看到类似这样的内容:
#
# User accounts configuration
#
# NOTE: If you have AccountsService installed on your system, then LightDM will
# use this instead and these settings will be ignored
#
# minimum-uid = Minimum UID required to be shown in greeter
# hidden-users = Users that are not shown to the user
# hidden-shells = Shells that indicate a user cannot login
#
[UserAccounts]
minimum-uid=500
hidden-users=nobody nobody4 noaccess
hidden-shells=/bin/false /usr/sbin/nologin
我们感兴趣的是以下部分:
hidden-users=nobody nobody4 noaccess
要隐藏用户名james
,只需像这样添加:
hidden-users=nobody nobody4 noaccess james
然后,重新启动计算机,该错误就消失了。
作为对其他人的参考,请参阅
看https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/857651
在某些版本的 lighdm(Ubuntu 14.04)上,您需要重命名[UserAccounts]
为[UserList]
(in /etc/lightdm/users.conf
)才能使此方法起作用。(如果您对为什么这可能是必要的感兴趣,请参阅common/user-list.c:321
lightdm 源代码。)
答案3
您的选择直到错误 857651解决方法是创建 uid < 1000 的用户
例如,要分配小于 1000 的新 uid(我们使用 999),请使用此命令
sudo usermod -u 999 user-name
用实际用户名替换user-name
,就像anwar
或detly
等等。
答案4
此方法不适用于 Ubuntu 13.10。
要正确隐藏用户登录名,您必须打开 LightDM 配置:
sudo vim /etc/lightdm/lightdm.conf
并添加以下选项:
greeter-hide-users=true
greeter-show-manual-login=true
然后保存并重启。就这样。