Ubuntu 20.04 允许 GUI root 登录

website: https://linuxconfig.org/how-to-allow-gui-root-login-on-ubuntu-20-04-focal-fossa-linux

In this article you will find out how to allow the root user to login to GUI gnome Desktop on Ubuntu 20.04 Focal Fossa.

In this tutorial you will learn:

  • How to set root password
  • How to configure GDM to allow root gui login
  • How to configure PAM to allow root gui login

Allow GUI root login on Ubuntu 20.04 Focal Fossa Linux Desktop

Allow GUI root login on Ubuntu 20.04 Focal Fossa Linux Desktop

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
CategoryRequirements, Conventions or Software Version Used
SystemInstalled Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
SoftwareN/A
OtherPrivileged access to your Linux system as root or via the sudo command.
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Allow GUI root login on Ubuntu 20.04 step by step instructions



  1. First step is to set root password:

    $ sudo passwd
    

    The above command will set a root password which will be later user to login to GUI.

  2. Next, step is to edit the /etc/gdm3/custom.conf GDM configuration file to allow root login.

    ALTTEXT

    use your favourite text editor and as a root user edit the /etc/gdm3/custom.conf file to add the AllowRoot=true line.

  3. Next, edit PAM authentication daemon configuration file /etc/pam.d/gdm-password and comment line which denies root access to graphical user interface.

    To do so edit file /etc/pam.d/gdm-password and put # in front of the line containing:

    auth   required        pam_succeed_if.so user != root quiet_success
    

    Comment line which denies root's access to graphical user interface

    Comment line which denies root’s access to graphical user interface

  4. All done. Reboot your Ubuntu system.

    enter root's credentials

    Upon a new login select Not listed? and enter root’s credentials.

Related Linux Tutorials:

Categories Ubuntu Tags administration, beginner, desktop, ubuntu, ubuntu 20.04

Post navigation

Default root password on Ubuntu 20.04 Focal Fossa Linux

How to analyze and interpret Apache Webserver Log

### Ubuntu 20.04 和 Windows 的互操作性及转换指南 #### 使用 WSL 实现 Ubuntu 20.04 和 Windows 的互操作性 对于希望在同一台机器上同时利用 Linux 和 Windows 功能的开发者来说,Windows Subsystem for Linux (WSL) 是一种理想的选择。通过 WSL,在不改变原有工作流的情况下可以在 Windows 上运行完整的 Linux 发行版环境。 - **WSL 安装** 为了在 Windows 中启用并安装 Ubuntu 20.04 LTS: 1. 打开 PowerShell 并以管理员身份执行命令 `wsl --install` 或者更具体地指定版本号 `wsl --install -d Ubuntu-20.04`[^1]。 2. 启动刚安装好的 Ubuntu 应用程序来完成设置过程,包括创建新的 UNIX 用户名和密码。 3. 更新软件包列表并升级已有的软件包到最新版本: ```bash sudo apt update && sudo apt upgrade -y ``` #### 图形界面支持 取决于所使用的 WSL 版本(WSL1 或 WSL2),图形应用程序的支持也有所区别。对于想要体验桌面环境或者需要 GUI 工具的情况,可以通过配置远程显示服务器如 VcXsrv 来实现[Xfce4 + VcXsrv]。 #### 文件系统共享 WSL 提供了一个方便的方式让两个操作系统之间互相访问文件。默认情况下,可以从 Linux 终端直接读写位于 `/mnt/c/...` 下面的 Windows 文件夹;反之亦然,虽然效率较低但仍然可行的是从 Windows 探索器浏览至 `%localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_...\LocalState\rootfs\home\[username]\..` 查看 Linux 主目录下的内容。 #### 数据库管理工具 phpMyAdmin 配置注意事项 如果计划在这样的混合环境中部署 web 开发项目,则可能涉及到数据库的操作。值得注意的是,在 Ubuntu 20.04 环境下,默认 root MySQL/MariaDB 账户采用 auth_socket 认证机制而非传统密码验证模式[^3]。这意味着为了让 phpMyAdmin 正常连接数据库服务,或许有必要调整此行为或另外建立具有适当权限的新用户账号用于此类目的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值