Linux ssh-keygen - 如何设置具有特定用户名的 rsa 密钥

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6515640/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:49:20  来源:igfitidea点击:

ssh-keygen - how to set an rsa key with a certain username

linuxubuntusshrsassh-keys

提问by George Mauer

I just installed ubuntu and would like to set its rsa keys up with bitbucket/github. When I ssh-keygen the keys are generated as they should be

我刚刚安装了 ubuntu,想用 bitbucket/github 设置它的 rsa 密钥。当我 ssh-keygen 生成密钥时,它们应该是

ssh-rsa AA...yBEz3pLL georgemauer@ubuntu

which is perfectly usable except the username part. In every rsa key I've generated previously, the username section read my email address:

除了用户名部分之外,这是完全可用的。在我之前生成的每个 rsa 密钥中,用户名部分都会读取我的电子邮件地址:

ssh-rsa AA...yBEz3pLL [email protected]

No, it's not a major impediment but if I don't get this right it will drive me crazy. How, do I generate with rsa keys with an email username of my choice?

不,这不是一个主要障碍,但如果我没有做对,它会让我发疯。如何使用我选择的电子邮件用户名使用 rsa 密钥生成?

采纳答案by datasage

Use the -Coption to provide a new comment with your key.

使用该-C选项为您的密钥提供新评论。