默认 系统 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. Mybatis学习(1)开发环境搭建

    什么是mybatis MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索.MyBatis使用简单的XML ...

  2. 前端-Vue基础3(父子组件交互)

    1.子组件往父组件传值 点击子组件的值,子组件自增,父组件的值也跟着自增 通过:this.$emit('change')方法向父组件暴露事件,在子组件中引用,可以调用父组件的方法 点击子组件触发cli ...

  3. python pyinsane应用

    import sys from PIL import Image try: import src.abstract as pyinsane except ImportError: import pyi ...

  4. 团队开发day10

    项目整合成功,测试功能基本达到,目标完成!

  5. 框架学习系列 mybatis mapper映射文件之输出映射

    1: mapper映射文件输出映射(输入类型) 2:resultType的使用 3:resultMap的使用 3:总结&下节预告 本文是<凯哥陪你学系列-框架学习之mybatis框架学习 ...

  6. Spring RestTemplate 之中文乱码

    由于RestTemplate的默认构造方法初始化的StringHttpMessageConverter的默认字符集是ISO-8859-1,所以导致RestTemplate请求的响应内容会出现中文乱码. ...

  7. 【搜索】棋盘 luogu-3956

    分析 按照这个题目随便写一个搜索就可以了 AC代码 #include <cstdio> #include <cstring> #include <algorithm> ...

  8. 【贪心+排序】排队接水 luogu-1223

    题目描述 有n个人在一个水龙头前排队接水,假如每个人接水的时间为Ti,请编程找出这n个人排队的一种顺序,使得n个人的平均等待时间最小. 分析 注意要开longlong AC代码 #include &l ...

  9. []*T *[]T *[]*T 傻傻分不清楚

    前言 作为一个 Go 语言新手,看到一切"诡异"的代码都会感到好奇:比如我最近看到的几个方法:伪代码如下: func FindA() ([]*T,error) { } func F ...

  10. ifix vba 读取计算机中的txt文件,截取字符串显示

    利用vba脚本,使用Scripting.FileSystemObject对象可以实现对文本文件的操作,下面以一个朋友的实际例子为例将截获的字符串进行页面显示. Private Sub CommandB ...