8841浏览
查看: 8841|回复: 5

【Linux教程】——Ubuntu设置root自动登录

[复制链接]
ubuntu默认无法通过登陆窗口lightdm登陆root用户,但是我们可以通过配置让lightdm支持root登陆。
1、配置root用户密码
普通用户下使用如下的命令,
$sudo passwd root  
输入普通用户密码,再输入root用户密码。

2、两种配置的方式
     1)可以新建lightdm.conf 文件
      $sudo gedit  /etc/lightdm/lightdm.conf
      在其中填写入如下的内容,然后重启,选择“登陆”输入root用户密码:
      [SeatDefaults]
      user-session=ubuntu
      greeter-show-manual-login=true
     2)也可以编辑50-ubuntu.conf文件
     $sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf   
     在其中添加如下的内容,重新启动,选择“登陆”输入root用户密码:
     greeter-show-manual-login=true

3、配置root自动登陆
可以编辑lightdm.conf
$sudo gedit  /etc/lightdm/lightdm.conf
再其中添加如下的内容,同样重新启动,登陆中用root登陆:
[SeatDefaults]
autologin-user=root
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true
allow-guest=false

凌风清羽  中级技匠
 楼主|

发表于 2017-3-10 14:02:45

又get一个新技能,哈哈~~
回复

使用道具 举报

hnyzcj  版主

发表于 2017-3-10 14:11:35

凌风清羽 发表于 2017-3-10 14:02
又get一个新技能,哈哈~~

学习了,
回复

使用道具 举报

凌风清羽  中级技匠
 楼主|

发表于 2017-3-10 16:52:55

凌风清羽 发表于 2017-3-10 14:02
又get一个新技能,哈哈~~

在上文基础上增加autologin-user=root,企图自动登录root账户,结果报错Error found when loading /root/.profile stdin: is not a tty
更改/root/.profile文件
把mesg n 进行注释,增加一行 tty -s && mesg n
然后reboot
回复

使用道具 举报

御坂美琴  学徒

发表于 2017-3-11 14:04:16

为何不用Vim。。。
回复

使用道具 举报

凌风清羽  中级技匠
 楼主|

发表于 2017-3-20 16:07:54


这是搬的别人的帖子,实际操作中还是使用VIM的

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail