新建一个实例后,会生成一个私钥A
使用私钥A远程登录服务器
导入私钥A,文件无格式要求
设置密码
输入passwd root后会提示输入new password,输入一个root的密码,需要再输入一遍进行验证
passwd root
修改配置文件
vi /etc/ssh/sshd_config
把PermitRootLogin yes前的注释去掉
#PermitRootLogin yes
把 PasswordAuthentication yes前的注释去掉
#PasswordAuthentication yes
重启服务
systemctl restart sshd.service