admin管理员组

文章数量:1593500

银河麒麟操作系统开机root自动登录


通过以下配置可使银河麒麟系统开机后使用root用户自动登录:

  1. 先给root用户设置密码:
$ sudo passwd root
  1. 编辑/etc/lightdm/lightdm.conf(若没有直接新建),内容如下:
[SeatDefaults]
 autologin-user=root
 user-session=mate
 greeter-show-manual-login=true

注意:若存在lightdm.conf则不需要步骤(3)

  1. 若lightdm.conf文件不存在,则在teminal下输入:
# vim /usr/share/lightdm/lightdm.conf.d/60-kylin.conf

内容如下

[SeatDefaults]
autologin-user=root
user-session=mate
greeter-show-manual-login=true
  1. 在terminal下输入:
#  vim /root/.profile

将文件末尾的 mesg n || true,修改为 tty -s && mesg n || true
注意:如果这里不修改,登录会提示如下信息:
Error found when loading /root/.profile
stdin:is not a tty

  1. 重启即可生效。

本文标签: 麒麟银河自动登录操作系统root