- 进入~/.ssh目录,生成ssh
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "[your email address]"
# 代码参数含义:
# -t 指定密钥类型,默认是 rsa ,可以省略。
# -C 设置注释文字,比如邮箱。
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:XeSxgSCYafkI81zS5Mhkc5KNRZIA1VBu68fv7+uHvlA [your email address]
The key's randomart image is:
+---[RSA 2048]----+
|.o+=oX+ .. .+ |
| .X.o. .o + |
| o+ .+ |
| . . ..+. |
| .. S*Eo |
| . .+ *.+ |
| ..oo.= . |
| +. ..o . |
| ..oo +*+ |
+----[SHA256]-----+
- 复制生成的公钥
$ clip < id_rsa.pub
- 将刚刚复制的公钥添加到github
- 测试
$ ssh -T git@github.com
Hi [your name]! You've successfully authenticated, but GitHub does not provide shell access.
网友评论