4D蚂蚁-4d蚂蚁-www.4dmayi.com|4D蚂蚁博客

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

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
退出移动版