Windows使用SSH Secure Shell实现免密码登录CentOS

笔记来自:http://blog.csdn.net/jiangshouzhuang/article/details/50683049

1.在Windows上生成密钥
找到Secure Shell Client的安装目录
C:Program Files (x86)SSH Communications SecuritySSH Secure Shell

在命令行下进入Secure Shell Client安装目录并生成密钥
>cd C:Program Files (x86)SSH Communications SecuritySSH Secure Shell
>ssh-keygen2.exe -t rsa

找到私钥和公钥的实际目录:
C:UsersAdministratorAppDataRoamingSSHUserKeys

2.导入到CentOS服务器

把id_rsa_2048_a.pub文件上传到CentOS服务器,放在/home/coffee/.ssh目录下。

因为公钥是在Windows上生成,CentOS的Openssh不识别,所以进行转换后再追加到authorized_keys中
ssh-keygen -i -f id_rsa_2048_a.pub >>authorized_keys

3.Public Key方式登录成功

原文地址:https://www.cnblogs.com/coffee_cn/p/8548360.html