我在libre办公室打开了我的公钥并编辑了密钥的评论部分然后保存了。但是当我跑步时:
ssh-keygen -l -f id_rsa.pub
我明白了:
id_rsa.pub is not a public key file.
该文件不再被识别为公钥文件。我该如何解决这个问题?
答案 0 :(得分:8)
您可能无法使用复杂的文本编辑器打开此文件。 使用Notepad ++或gedit (类似这样)来编辑文件。
然后,验证您在' ssh-rsa'之间有空格。和钥匙开头的" AAAA ....." 。
要重新生成您的公钥,请使用-y选项,如下所示:
ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub
我希望它能解决你的问题:)
来自
man ssh-keygen
:-y This option will read a private OpenSSH format file and print an OpenSSH public key to stdout.