ssh从备份的私钥中获取旧的公钥


0

我备份并加密了我的私钥,但没有别的。

我试图从中获取公钥,但不知道如何。我正在尝试,ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub但是它说id_rsa上的权限太开放,因此该密钥将被忽略。

我搞砸了还是可以找回我的公钥?

Answers:


1

如果openssh拒绝读取文件,则可以使用openssl

openssl rsa -in ~/.ssh/id_rsa -pubout -out ~/.ssh/id_rsa.pub

不过,在更正权限之前,您将无法使用它们中的任何一个。

~必须是775最多,~/.ssh700,~/.ssh/id_rsa600

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.