Ubuntu 系统直接使用 root 用户登录实例

10 篇文章 0 订阅
9 篇文章 0 订阅
本文指导如何在Ubuntu系统中设置root用户密码,修改SSH配置以允许root登录,并重启服务。步骤包括设置密码、修改PermitRootLogin和PasswordAuthentication参数。
摘要由CSDN通过智能技术生成

1.设置linux root用户密码

a.打开Terminal ,并输入“sudo passwd root” 命令。
b.出现 [sudo] password for linux: 后 输入用户密码。
c.出现 Enter new UNIX password: 后输入root密码。
d.出现 Retype new UNIX password: 后确认root密码。
e.passwd: password updated successfully 后root用户密码设置成功了。

2.修改SSH 配置文件

sudo vi /etc/ssh/sshd_config 

进入sshd_config 后找到并修改 PermitRootLogin 和 PasswordAuthentication 两个参数
修改为

PermitRootLogin prohibit-password
#PasswordAuthentication yes
#修改为
PermitRootLogin yes
PasswordAuthentication yes

3.重启 ssh 服务即可使用root账户登录

sudo service ssh restart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值