Home » Questions » Computers [ Ask a new question ]

Purpose of username in OpenSSH public key file?

Purpose of username in OpenSSH public key file?

Let's say that my username is user and my computer name is cmp. I notice they are also part of my SSH public key:

Asked by: Guest | Views: 238
Total answers/comments: 1
Guest [Entry]

"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 key goes on its own line and each person gets their own key 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."