How do I validate an RSA SSH public key file (id_rsa.pub)?

You can use ssh-keygen for this. Despite its name it can do many more things than generating keys: dennis@lightning:~$ ssh-keygen -l -f .ssh/id_rsa.pub 2048 68:df:b2:22:d8:43:5d:36:75:c1:d8:59:c0:8c:22:e8 Dennis Kaarsemaker (RSA) dennis@lightning:~$ ssh-keygen -l -f foo.txt foo.txt is not a public key file.

SSH keypair generation: RSA or DSA?

RSA is generally preferred (now that the patent issue is over with) because it can go up to 4096 bits, where DSA has to be exactly 1024 bits (in the opinion of ssh-keygen). 2048 bits is ssh-keygen‘s default length for RSA keys, and I don’t see any particular reason to use shorter ones. (The minimum … Read more

SSH Suddenly returning Invalid format

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 … Read more

Possible to change email address in keypair?

I’ve created an RSA keypair that I used for SSH, and it includes my email address. (At the end of the public key.) That part of an ssh key is just a comment. You can change it to anything you want at any time. It doesn’t even need to be the same on different servers. … Read more

RSA Public Key format

You can’t just change the delimiters from —- BEGIN SSH2 PUBLIC KEY —- to —–BEGIN RSA PUBLIC KEY—– and expect that it will be sufficient to convert from one format to another (which is what you’ve done in your example). This article has a good explanation about both formats. What you get in an RSA … Read more