- 使用puttygen 生成秘钥
- 将公钥复制到 /root/.ssh/authorized_keys 文件中
- 修改配置文件,文件地址:/etc/ssh/sshd_config
#启用密码登录 PasswordAuthentication no #开启密钥登录 RSAAuthentication yes
* 需将 /etc/ssh/sshd_config.d/50-cloud-init.conf 这个文件删除,否则启用密码登录 no 不生效
- 重启 ssh
service ssh restart
© 版权声明
THE END
请登录后查看评论内容