The ssh public keys in authorized_hosts have three parts - a type, the key and a name. For example, an rsa key might look like:

ssh-rsa gn29JyDdiyLFlggptrCxgzS6diAF6o94Dtg<abbreviated>oF9grbm7g+Mtrly NAME1

Will the same key be valid with a different name, e.g.:

ssh-rsa gn29JyDdiyLFlggptrCxgzS6diAF6o94Dtg<abbreviated>oF9grbm7g+Mtrly NAME2

What I've tried:

I tried changing the name part on the receiving env, and the authentication worked as usual

I wonder if there is a solid reference that mentions that the name is not a part of the authentication process in any scenario - I couldn't find it in the manual.


Thanks for the answers and comments. I think this question is not off topic, because the terms I have searched are different than the ones on the documentation (name vs. comment). Therefore, this question might be a useful point of entrance to searches on this topic in the future.

  • Wow. Why the harsh downvote?
    – Adam Matan
    Oct 15, 2014 at 11:03
  • I think it's because we kind of value people doing a bit of their own research. I mean, your question really amounts to 'Will somebody read the documentation for me ...'
    – user9517
    Oct 15, 2014 at 11:37
  • Regarding your update: I think you missed my point. earch is not the documentation. Had you read the documentation it would have (in this case) provided you with the answer to your question. Even if it didn't directly answer your question, it is likely that the documentation would provide you with information that would help you search better.
    – user9517
    Oct 21, 2014 at 9:37

1 Answer 1


Protocol 2 public key consist of: options, keytype, base64-encoded key, comment.

There are actually more parts, but they could be (and almost always are) empty. The last part is comment and could be anything. So the answer to you question is NO, comment is not part of authentication.

You could read more in documentation: http://www.linuxcertif.com/man/5/authorized_keys/#AUTHORIZED_KEYS_FILE_FORMAT_14h

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