我ssh-keygen
在OS X上运行,当我显示生成的公钥时,我看到我的登录名和机器名出现在密钥的最后部分.有没有办法让它使用不同的值或根本不使用它?
从联机帮助页'ssh-keygen(1)':
For RSA1 keys, there is also a comment field in the key file that is only for convenience to the user to help identify the key. The comment can tell what the key is for, or whatever is useful. The comment is initialized to “user@host” when the key is created, but can be changed using the -c option. … -C comment Provides a new comment. -c Requests changing the comment in the private and public key files. This operation is only supported for RSA1 keys. The program will prompt for the file containing the private keys, for the passphrase if the key has one, and for the new comment.
因此,在创建密钥时,您可以使用它-C "$desiredcommenttext"
来提供您喜欢的任何评论文本; 或者对于现有密钥,请使用该-c
选项更改注释.
是! 它根本不需要,它只是随意添加,以便您记住它来自哪里.如果要编辑它,只需打开终端会话并键入:
$ nano ~/.ssh/id_rsa.pub
删除行的末尾部分(在双等号之后).