Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh id_rsa.pub不是公钥文件_Ssh_Openssh - Fatal编程技术网

Ssh id_rsa.pub不是公钥文件

Ssh id_rsa.pub不是公钥文件,ssh,openssh,Ssh,Openssh,我在libre office中打开了我的公钥,编辑了该密钥的注释部分,然后保存。但当我跑步时: ssh-keygen -l -f id_rsa.pub 我得到: id_rsa.pub is not a public key file. 该文件不再被识别为公钥文件。如何解决此问题?您可能无法使用复杂文本编辑器打开此文件使用记事本++或gedit(类似于此)编辑文件 然后,验证密钥开头的“ssh rsa”和“AAAA…”之间是否有空格 要重新生成公钥,请使用-y选项,如下所示: ssh-key

我在libre office中打开了我的公钥,编辑了该密钥的注释部分,然后保存。但当我跑步时:

ssh-keygen -l -f id_rsa.pub 
我得到:

id_rsa.pub is not a public key file.

该文件不再被识别为公钥文件。如何解决此问题?

您可能无法使用复杂文本编辑器打开此文件使用记事本++或gedit(类似于此)编辑文件

然后,验证密钥开头的“ssh rsa”和“AAAA…”之间是否有空格

要重新生成公钥,请使用-y选项,如下所示:

ssh-keygen-f~/.ssh/id\u rsa-y>~/.ssh/id\u rsa.pub

我希望它能解决您的问题:)

manssh-keygen

-y      This option will read a private OpenSSH format file and print an OpenSSH public key to stdout.

来源:

在记事本++中打开文件,检查libre office是否未更改格式。word和libre office等程序很容易更改文档格式,甚至可以将“in”等字符更改为“in”,仅举一个例子。他们还倾向于在文件中添加随机换行符。我没有备份密钥,因此无法进行比较。