ssh用私钥生成公钥


ssh用私钥生成公钥

问题描述: ssh秘钥对只剩下了私钥,如何用私钥来生成对应的公钥?
解决方案:用git bash输入 ssh-keygen 指令

  • 在屏幕上显示私钥生产的公钥
ssh-keygen -y -f .vagrant/machines/default/virtualbox/private_key

note: -f 参数指定私钥文件

  • 生成公钥到对应的文件中
ssh-keygen -y -f .vagrant/machines/default/virtualbox/private_key > key.pub

  • ssh-keygen 帮助