Ubuntu 22.04-修改自动登陆密码

在Ubuntu系统中,如果您设置了自动登录功能,通常是通过修改/etc/gdm3/custom.conf(针对GDM)或/etc/lightdm/lightdm.conf(针对LightDM)文件来实现的。这种情况下,系统不会要求用户输入密码,因此您可能无法通过常规方式修改密码(即使用passwd命令修改密码,也不生效)。

sudo apt-get install net-tools
sudo apt-get install vim
sudo vim /etc/gdm3/custom.conf
[daemon]
AutomaticLoginEnable=False

取消了自动登陆后,可使用passwd命令修改密码

之后可以通过再次设置自动登陆,而使自动登陆和密码生效

原文链接:https://mp.weixin.qq.com/s/wKhp1eSZQ_gJvahlfqlH9A

posted @ 2025-08-04 10:28  peakgrin  阅读(113)  评论(0)    收藏  举报