默认 系统 root 登录 图形界面,出现 登录失败。解决方法如下:

1,登录普通用户, 打开终端执行命令, 使用su root或sudo -i切换到root用户(必须)

su root

按照提示输入密码即可切换用户。

若root账户密码忘记,使用如下命令重设后再切换。

sudo passwd root

2,在终端中输入如下命令,打开文件

gedit /etc/pam.d/gdm-autologin

将打开的文件中第三行前加#,如下注释掉语句 “auth required pam_succeed_if.so user != root quiet_success”

#%PAM-1.0
auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success
auth optional pam_gdm.so
auth optional pam_gnome_keyring.so
auth required pam_permit.so
@include common-account
# SELinux needs to be the first session rule. This ensures that any
# lingering context has been cleared. Without this it is possible
# that a module could execute code in the wrong domain.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session required pam_loginuid.so
# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context. Only sessions which are
# intended to run in the user's context should be run after this.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
session optional pam_keyinit.so force revoke
session required pam_limits.so
session required pam_env.so readenv=1
session required pam_env.so readenv=1 user_readenv=1 envfile=/etc/default/locale
@include common-session
session optional pam_gnome_keyring.so auto_start
@include common-password

3,保存并退出,继续在终端执行

gedit /etc/pam.d/gdm-password

将打开的文件中第三行语句加#注释掉,如下图

#%PAM-1.0
auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success
@include common-auth
auth optional pam_gnome_keyring.so
@include common-account
# SELinux needs to be the first session rule. This ensures that any
# lingering context has been cleared. Without this it is possible
# that a module could execute code in the wrong domain.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session required pam_loginuid.so
# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context. Only sessions which are
# intended to run in the user's context should be run after this.
# pam_selinux.so changes the SELinux context of the used TTY and configures
# SELinux in order to transition to the user context with the next execve()
# call.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
session optional pam_keyinit.so force revoke
session required pam_limits.so
session required pam_env.so readenv=1
session required pam_env.so readenv=1 user_readenv=1 envfile=/etc/default/locale
@include common-session
session optional pam_gnome_keyring.so auto_start
@include common-password

4,保存并退出。在终端继续执行

gedit /root/.profile

将打开的文件中“mesg n 2> /dev/null || true” 改为

tty -s&&mesg n 2> /dev/null || true

5,保存并退出。

6,重启电脑,即可以root用户登录。

参考文章: 解决Ubuntu使用ROOT账户登录图形界面报错认证失败_D&T的博客-CSDN博客

Ubuntu系统Root用户无法登录的更多相关文章

  1. 解决ubuntu系统root用户下Chrome无法启动问题

    由于ubuntu16.04系统自带的是Firefox浏览器,需要安装Chrome浏览器,但是在root用户下安装后发现,Chrome无法正常启动.安装及问题解决具体如下: 1. ubuntu上Chro ...

  2. ubuntu开启ROOT用户自动登录教程

    ub默认不开root很纠结,虽说是为了安全,但对于linux老鸟,老是sudo烦的很 开root方法: sudo passwd root 输入root密码 sudo gedit /etc/gdm/cu ...

  3. Ubuntu设置root用户登录图形界面

    Ubuntu默认的是root用户不能登录图形界面的,只能以其他用户登录图形界面.这样就很麻烦,因为权限的问题,不能随意复制删除文件,用gedit编辑文件时经常不能保存,只能用vim去编辑. 解决的办法 ...

  4. root用户远程登录Ubuntu

    安装了一台Ubuntu的服务器,由于大家都需要使用,因此创建了多个用户,多台windows机器用过Putty远程登录,但是默认情况下创建的用户都是普通用户,也就是说很多root用户能够使用的权限以及命 ...

  5. ubuntu拒绝root用户ssh远程登录解决办法

    ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录,解决办法就是:修改ssh配置,然后重启ssh服务即可. vi /etc/ssh/sshd_config 找到并用#注 ...

  6. Ubuntu中root用户和user用户

    从user用户切换到root用户 在ununtu系统中缺省用户是user,出于安全考虑,默认时Ubuntu的root用户时没有固定密码的,它的密码是随机产生并且动态改变的. 但是有的时候我们的用户要执 ...

  7. Ubuntu中root用户和user用户的相互切换

    转:Ubuntu是最近很流行的一款Linux系统,因为Ubuntu默认是不启动root用户,现在介绍如何进入root的方法. (1)从user用户切换到root用户 不管是用图形模式登录Ubuntu, ...

  8. Ubuntu中root用户和user用户的相互切换(转)

    Ubuntu是最近很流行的一款Linux系统,因为Ubuntu默认是不启动root用户,现在介绍如何进入root的方法. (1)从user用户切换到root用户 不管是用图形模式登录Ubuntu,还是 ...

  9. [转]Ubuntu中root用户和user用户的相互切换

    [转]Ubuntu中root用户和user用户的相互切换 http://www.cnblogs.com/weiweiqiao99/archive/2010/11/10/1873761.html Ubu ...

随机推荐

  1. spring cloud服务器启动之后立刻通过zuul访问其中的实例报zuul连接超时的问题

    spring cloud服务启动之后,立刻进行调用 报错:com.netflix.zuul.exception.ZuulException: Forwarding error Caused by: c ...

  2. ABP Framework 为什么好上手,不好深入?探讨最佳学习姿势!

    离写上一篇经验总结 ABP Framework 研习社经验总结(6.28-7.2) ,已经过去两周. ABP Framework 研习社(QQ群:726299208) 最近一周,又迎来了很多新伙伴,成 ...

  3. Ionic命令笔记

    Ionic命令:ionic serve 开启服务调试ionic cordova prepare android 生成android原生项目 ionic cordova run browser 打包成混 ...

  4. 『心善渊』Selenium3.0基础 — 29、使用HTMLTestRunner生成unittest的HTML报告

    目录 1.HTMLTestRunner介绍 2.HTMLTestRunner的使用 3.测试报告示例 4.封装成模块 1.HTMLTestRunner介绍 HTMLTestRunner是一个基于uni ...

  5. Django基础-02篇 Models的属性与字段

    1.models字段类型 AutoField():一个IntegerField,根据可用ID自动递增.如果没指定主键,就创建它自动设置为主键. IntegerField():一个整数: FloatFi ...

  6. python03篇 字符串常用方法和文件操作(一)

    一.字符串常用方法 s1 = ' abcsfsfaadfdd ' s = s1.strip() print(s) print(len(s.strip())) print(s.count('a')) # ...

  7. 禅道项目管理软件-Linux上一键安装

    一.安装 1.将安装包直接解压到/opt目录下 特别说明:不要解压到别的目录再拷贝到/opt/,因为这样会导致文件的所有者和读写权限改变,也不要解压后把整个目录777权限. 可以使用命令: tar - ...

  8. asp.net c#从SQL2008读取图片显示到网页

    //图像数据表:tx//字段id (nvarchar(50) ,image(image)//tgav为图片ID,实质为上传前的主名 (省略了.jpg) using System; using Syst ...

  9. Java基础00-形参和返回值22

    1. 形参和返回值 1.1 类名作为形参和返回值 1.2 抽象类名作为形参和返回值 代码示例: 方法的形参是抽象类名 抽象动物类:定义了一个抽象的eat方法 动物的操作类:创建一个useAnimal方 ...

  10. etcd学习(3)-grpc使用etcd做服务发现

    grpc通过etcd实现服务发现 前言 服务注册 服务发现 负载均衡 集中式LB(Proxy Model) 进程内LB(Balancing-aware Client) 独立 LB 进程(Externa ...