问题原文
原帖链接 · Basil A · CC BY-SA 3.0
I can’t figure out why does an SSH public key file generated by ssh-keygen have a user and host at the end of it.
Example: id_rsa.pub
ssh-rsa ... rest of file ... /CA9gyE8HRhNMG6ZDwyhPBbDfX root@mydomain
Notice the root@mydomain at the end of the file.
If I can use the public key anywhere with any user to authenticate using my private key, what significance does the root@mydomain have on the authentication process?
Or is it just a place holder to figure our who was it issued by?
已采纳解答
原帖链接 · Michael Hampton · CC BY-SA 4.0
This field is a comment, and can be changed or ignored at will. It is set to user@host by default by ssh-keygen.
The OpenSSH sshd(8) man page describes the format of a public key thus:
Public keys consist of the following space-separated fields: options, keytype, base64-encoded key, comment. . . . The comment field is not used for anything (but may be convenient for the user to identify the key).
The ssh-keygen(1) man page says:
The key comment may be useful to help identify the key. The comment is initialized to “user@host” when the key is created, but can be changed using the -c option.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
