ssh-copy-id 实现ssh无密码登录 openssh putty

ssh-keygen 生成公私钥对

$ssh-keygen

ssh-copy-id将本机的公钥复制到远程机器

ssh-copy-id -i .ssh/id_rsa.pub(公钥路径)  用户名字@192.168.x.xxx

ssh -i 选择对应私钥进行登录 

$  ssh 用户名字@192.168.x.xxx -i 私钥路径

资源来源自网络,保持更新,转载请注明出处。如果对你有帮助,请点击推荐进行支持,感谢!

更新:2019年6月12日12:55:48

windows 下使用putty 私钥登录的时候,openssh 生成的私钥不能直接被putty 直接使用,需要先用 puttygen.exe 进行重新保存成putty可用格式,然后再添加到putty之中;

私钥格式转换:

私钥登录配置:

常见错误: Unable to use key file "id_rsa" (OpenSSH SSH-2 private key)

参考链接:

http://blog.chinaunix.net/uid-21482701-id-11159.html

https://www.cnblogs.com/liuhaitao/p/6339926.html

保持更新; 

原文地址:https://www.cnblogs.com/xuyaowen/p/ssh-copy-id.html