I have generated SSH keys for a new server installation according to the procedure outlined here. However, when I copy the contents of id_rsa.pub
to my keys list on
I was having the same issue, despite copying the public key from cat
output directly from the terminal (Cmder/ConEmu). It seems that the method that you use to copy the public key seems to make a difference. Here is a way to check:
$ ssh-keygen -l -f ~/.ssh/id_rsa.pub
4096 SHA256:...
Then paste the key that fails into a new file, and try to verify that:
$ ssh-keygen -l -f test.pub
test.pub is not a public key file.
In my case I had been copying the key from terminal output using cat
; instead getting the key from vim
worked. Here is way to open the key in vim with word wrap enabled:
$ vim "+set wrap" ~/.ssh/id_rsa.pub
I suspect that the terminal emulator may have something to do with it as I haven't had this issue with Terminal.app.