vote up 2 vote down star

Let's say that my username is user and my computername is cmp. I notice they are also part of my SSH public key: (they are last, scroll right)

user@cmp:~/.ssh$ ls
config  id_rsa  id_rsa.pub  known_hosts
user@cmp:~/.ssh$ cat id_rsa.pub 
ssh-rsa AAAAB3Nzayc2EAABIwAAAQEA4kk3Guk5TwW+MihnO8XjhRLTY11rICPl5iIqlIHWcyuqYyFdoU4i/VHbJEBiti0fgBztSyZnrW45MyBRG5RU/AFsVuqiRNjyRB59zsLu/J3Uc+fqvy5qNTAAlcMprFnRN8M6PYl6Tp5gXncbuQaFJmuCgllTcrBrVX0Mep9UvRf5GrZBGprFrY4R/LjH1SFpkQTHFHMI8wMKlsPkJGJCW9+a/8zmqOrpoE9XRRCfunnROcSq+2MCTRWl7iiligkcdKOq+cbqBNTYV0/6rfyZexArHwh5TeaQVdduU0ESN3WVl5i6OwAx2AMz922zZZ/jKWA== user@cmp

What is the purpose of that information?

flag

38% accept rate

1 Answer

vote up 5 vote down check

It is just a comment. SSH does not use that information at all, and you can change it to anything you want.

If you have more than one key, you need to have some way to know what they are.

Like you, I only have one key because I find it is simpler that way.

I have put several keys into the ~/.ssh/authorized_keys file for certain accounts that several people need to share. Each person gets their own key, each of which is added to that file, so any of them may log on, and they are all authorized. Having that comment at the end makes it clear which key goes with which person.

link|flag
Thanks, very informative answer. I've read about the from statement which may restrict from which host a user may log on using his key. I guess == marks the end of the actual key and ssh-rsa is just a description of the hash algorithm that was used. – Kent Jul 30 at 0:34
1  
Kent: The == is Base64 padding, to make the encoded output length a multiple of 4 (bytes). And yes, ssh-rsa is used to tell the algorithm used, but RSA is an asymmetric encryption algorithm - not hashing. (The other one is DSA, with keys tagged ssh-dss.) – grawity Jul 30 at 9:19

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.