如何生成ssh密钥(适用于github) [英] How to generate ssh keys (for github)

查看:56
本文介绍了如何生成ssh密钥(适用于github)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:如何使用命令行生成ssh私钥和公钥(将在GitHub/GitLab中使用).

Question: How do I generate ssh private and public keys (to be used in GitHub/GitLab) using command line.

下面的命令生成错误 sh.exe":意外标记'('

我正在使用Windows XP.

I am using Windows XP.

$ ssh-keygen -t rsa -C "xxxx@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxxx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xxxx/.ssh/id_rsa.
Your public key has been saved in /c/Users/xxxx/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db xxxx@gmail.com

推荐答案

仅运行命令

ssh-keygen -t rsa -C "you@example.com"

从脚本第2行开始的其余所有内容都是ssh-keygen的输出.

All the rest beginning with line 2 of your script is the output of ssh-keygen.

然后用您的电子邮件地址替换you@example.com.

And replace you@example.com with your email address.

看看 ssh-keygen 手册查找其他选项.您应该通过在选项列表中添加 -b 4096 来使用更长的键.

Have a look at the manual for ssh-keygen to look for additional options. You should probably use a longer key by adding -b 4096 to the option list.

这篇关于如何生成ssh密钥(适用于github)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆