Git SSH

作者: AsaGuo | 来源:发表于2018-08-20 09:43 被阅读4次
  1. 进入~/.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]-----+
  1. 复制生成的公钥
$ clip < id_rsa.pub
  1. 将刚刚复制的公钥添加到github
  2. 测试
$ ssh -T git@github.com
Hi [your name]! You've successfully authenticated, but GitHub does not provide shell access.

相关文章

网友评论

      本文标题:Git SSH

      本文链接:https://www.haomeiwen.com/subject/izlkiftx.html