ssh key认证
生成新密钥,并上传
公钥
到服务器# 生成新密钥 ssh-keygen -t rsa -m PEM -b 4096 -C "邮箱" # 提示可以输入密码,今后认证时服务器和本地用密钥认证,密码用来验证密钥 # 上传公钥到服务器 scp ~/.ssh/id_rsa.pub 用户名@服务器:~/.ssh/authorized_keys
PowerShell中ssh连接
ssh 用户名@服务器 # 可见提示的密码认证是认证本地密钥
- Putty中连接
puttygen打开私钥
,提示格式太老,菜单key
\保存参数
设置一下,另存为ppk
格式的putty密钥。
putty中打开保存的会话,connection
\SSH
\Auth
\Credentials
,打开之前保存的ppk
密钥,重新保存会话。 - 参考
https://blog.csdn.net/black_cat7/article/details/139457572
https://zhuanlan.zhihu.com/p/587082161
https://www.dell.com/support/kbdoc/zh-cn/000217157/connectrix-b-series-how-to-use-putty-for-ssh-key-based-authentication
https://blog.csdn.net/chenzhengfeng/article/details/125827015
https://blog.csdn.net/knight_zhen/article/details/47001449