因为安全等因素,默认的ubuntu系统镜像禁止root和密码登录,因此如果需要root用户登录需要进行如下操作

创建云主机

如图所示: 创建ubuntu2204的云主机

点击命令行,打开云主机操作页面,并登录系统

修改/etc/ssh/sshd_conf的配置

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

修改/etc/ssh/sshd_config.d/60-cloudimg-settings.conf配置

PasswordAuthentication no 改为 PasswordAuthentication yes

重启ssh服务

systemctl restart ssh

绑定外部地址





远程连接

ssh root@10.0.28.225

作者:张旭  创建时间:2025-02-20 09:51
最后编辑:张旭  更新时间:2025-05-08 15:05