MinaMiGo
永遠の夏
Koizumi's Blog

Ubuntu 启用root用户并允许远程登录

一、前言

略。

二、正文

1.环境

系统版本:20.04 Desktop

处理器架构:x86_64

2.安装一些包

3.修改配置文件

使用sudo su命令切换到root用户再修改以下文件

(1)修改50-ubuntu.conf

添加以下两行

(2)修改/etc/pam.d/gdm-autologin

将第三行的auth required pam_succeed_if.so user != root quiet_success用#注释掉。

(3) /etc/pam.d/gdm-password

将第三行的auth required pam_succeed_if.so user != root quiet_success用#注释掉

(4)修改SSH配置文件,允许root用户远程登录

找到

#PermitRootLogin prohibit-password

修改为

PermitRootLogin yes(记得把#去掉)

(5)修改/root/.profile

找到

mesg n 2> /dev/null || true

修改为

tty -s && mesg n || true

4.重启系统

执行reboot命令,重启系统。

本篇文章链接:https://blog.minamigo.moe/archives/144
转载请注明出处!日常分类下的文章禁止转载。

MinaMiGo

文章作者

发表回复

textsms
account_circle
email

Koizumi's Blog

Ubuntu 启用root用户并允许远程登录
一、前言 略。 二、正文 1.环境 系统版本:20.04 Desktop 处理器架构:x86_64 2.安装一些包 [crayon-66056164d9fb7003629615/] 3.修改配置文件 使用sudo su命令切换到root用户…
扫描二维码继续阅读
2020-06-08