默认 系统 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. buu 达芬奇 && ROT

    一.达芬奇 百度了下电影简介,发现了斐波那契数列,同时发现密文是由斐波那契数列移动而来的,有点像base64变种 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 ...

  2. 【故障公告】redis 服务器宕机引发博客站点故障

    非常抱歉,今天下午 17:10~17:40 左右,由于博客系统所使用的 redis 服务器宕机,造成博客站点无法正常访问,由此给您带来很大的麻烦,请您谅解. 我们会针对这次故障改进 redis 服务器 ...

  3. 生成Dll在Unity中使用

    我发现很多大佬,插件开发者以及Unity官方都在用Dll来保证既可让使用者正常使用也可有效防止使用者看到自己写的代码 版本说明 Visual Studio版本:2019 16.10.3 Unity版本 ...

  4. Django基础07篇 ORM操作

    1.新增(类似数据库操作的insert) # 新增 #方式一: models.Category.objects.create(name='MySQL') #方式二: c = models.Catego ...

  5. Linux常用基础命令(二)

    Linux常用基础命令 一.-ls--列表显示目录内容 二.-alias--设置别名 三.-du--统计目录及文件空间占用情况 四.-mkdir--创建新目录 五.-touch--创建空文件 六.-l ...

  6. React refs 的理解

    一.是什么 Refs 在计算机中称为弹性文件系统(英语:Resilient File System,简称ReFS) React 中的 Refs提供了一种方式,允许我们访问 DOM节点或在 render ...

  7. 每天五分钟Go - 函数基础

    函数在定义 Go的函数使用func来定义,返回类型支持多个值的返回 func 函数名([参数列]) [返回值类型]{ 方法执行体 } 参数列支持多个参数的声明,同一类型的函数,声明时和变量的声明一样 ...

  8. POJ3268-最短路径-反向存边

    因为是单向边,牛儿来回的路径长度并不相同,所以需要用两次dijkstra,一次正向从x开始dijkstra,再将边全部反向存再来一次. 因为是板子题比较良心n比较小,我们就可以用矩阵来存储啦.如果n比 ...

  9. 前端知识点--CSS overflow 属性

    问题:如何加滚动条? 给div 设置css 样式overflow:scroll div { width:150px; height:150px; overflow:scroll; } -------- ...

  10. 利用LRU策略实现Axios请求缓存

    业务场景 前一段时间刚做完一个项目,先说一下业务场景,有别于其他的前端项目,这次的项目是直接调用第三方服务的接口,而我们的服务端只做鉴权和透传,第三方为了灵活,把接口拆的很零散,所以这个项目就像扔给你 ...