修改 GDM 自动登录的账户
- GDM 的主配置文件是
/etc/gdm/custom.conf。
sudo vim /etc/gdm3/custom.conf
- 在打开的
custom.conf文件中,找到[daemon]部分。
需要修改或添加以下两行:
[daemon]
# 启用自动登录
AutomaticLoginEnable = true
# 设置要自动登录的用户名(请将 your_username 替换为实际用户名)
AutomaticLogin = your_username
AutomaticLoginEnable = true: 这一行启用自动登录功能。AutomaticLogin = your_username: 这一行指定了哪个用户将自动登录。请将your_username替换为想要自动登录的实际用户名(例如alice)。
示例:
假设想让用户 john 自动登录,那么配置应该看起来像这样:
[daemon]
AutomaticLoginEnable = true
AutomaticLogin = john
如果之前为其他用户设置过自动登录,直接修改 AutomaticLogin 后面的用户名即可。
- 在终端中运行以下命令进行重启验证
sudo reboot
留下评论