ubuntu-22.04允许root用户ssh远程登录

进入配置文件目录

cd /etc/ssh

编辑配置文件

先备份

cp sshd_config sshd_config"$(date +'%Y-%m-%d_%H-%M-%S')"

使用vim编辑

vim sshd_config

原来的:

#PermitRootLogin prohibit-password

编辑之后的:

#PermitRootLogin prohibit-password
PermitRootLogin yes

重启ssh服务

systemctl restart sshd

验证ssh服务状态

systemctl status sshd

这篇文章有用吗?

点击星号为它评分!

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位评论此文章。

发表评论