登录屏幕-设置默认用户

登录屏幕-设置默认用户

在登录屏幕上,我有两个选项:我的默认用户(假设为用户 1)和“其他用户”。当我以“其他用户”的身份工作并“注销”时,登录屏幕上的“活动”用户是“其他用户”。我希望每次注销/重启/启动后,活动用户都是我的默认用户。是否可以在登录屏幕上设置默认用户?提前感谢帮助。

问候,A

答案1

好像你也在 Ubuntu 论坛上发过这个帖子……我不确定这个问题是否有合适的解决方案。有一点很明显,我们必须处理 /etc/lightdm 中的 lightdm 配置文件才能完成此操作,至少在某种程度上是这样。

我尝试过修改 users.conf 文件,但目前为止没有成功。我尝试过修改 Guest,但也许在其他用户的情况下会成功,特别是如果您希望默认的这个用户比其他用户拥有更多的权限和访问权限。

我做的是这样的:

这是我的原始 users.conf 文件的样子:

# User accounts configuration
#
# NOTE: If you have AccountsService installed on your system, then #LightDMwill
# 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

我尝试将其更改为如下形式:

# 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]
uid < 1001
IncludeAll = true
Include = myuserhere
hidden-users=guest Guest

我的帐户的 UID 是 1000,所以我在那里使用了 1001......

您可以使用

id

命令来检查你自己的 uid,也许你也可以像这样在文件中设置:

uid=1000

我不确定这是否会起作用。

但是,上述配置不起作用。我认为我们必须在那里进行一些调整才能得到你想要的。请查看此问题以了解如何配置这些文件:如何更改登录屏幕上显示的默认用户?

上面的问题是关于 gdm 而不是 lightdm,但设置应该非常相似。所以,之后你就得自己想办法了。在更改它们之前,请参阅本手册:http://people.ubuntu.com/~robert-ancell/lightdm/reference/

此外,请确保备份这些配置文件,因为摆弄 lightdm 有时比其他任何事情都更浪费时间。请确保使用 Alt + F2/F1 等切换到 CLI,如果破坏了整个系统,请恢复备份。

祝你好运!

相关内容