问题原文
原帖链接 · Gregor Menih · CC BY-SA 3.0
So a while ago I set up a server on AWS, and used their generated SSH key. I saved the key to Lastpass, and have successfully retrieved it from there before, and got it working. However, after trying that again today, I can't get it to work.
-rw------- 1 itsgreg users 1674 Jun 6 12:51 key_name
I've tried ssh -i key_name, ssh-keygen -f key_name, but nothing works, I always get this error message:
Load key "key_name": invalid format
Is there any way to fix this?
已采纳解答
原帖链接 · 13dimitar · CC BY-SA 4.0
Check the contents of key_name, if the agent says invalid format, then there's something wrong with the key - like .. are you sure that's the correct key? Even if it's not the private key you need, the ssh agent won't return invalid format if the key is working, you simply won't be able to connect. You might have placed your public key in there, for some reason. Check it!
One common issue is if the file does not end with a newline. Add a newline, save, and try again.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
