标签:
Git经常添加到远程库时候经常由于SSHKey而上传失败,下面是创建SSHKey的过程:
1,首先输入命令:
[root@localhost ~]# ssh-keygen -t rsa -C "wuzhiyi51@gmail.com"
下面是创建过程:
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
cf:63:ac:28:60:4a:00:15:29:0c:8e:b6:d7:19:10:47 wuzhiyi51@gmail.com
The key‘s randomart image is:
+--[ RSA 2048]----+
|+.o=oE |
|=.. o |
|o+ . |
|o . . o |
|.. . o S |
| .+ + |
|.o . * |
|. . . o . |
| .. . |
+-----------------+
2,查看创建好的SSHKey文件
[root@localhost ~]# cat ~/.ssh/
id_rsa id_rsa.pub known_hosts
[root@localhost ~]# cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyFWY3VgY8D4IDqQKOCW3bTovL7cZunWaCIl69A16POCJIpNSymEZw2wUYfGdvwmX93kp4xEqPK9/rX30duLfRWgMNV8/YE6AGZo90YXfMmti/OXHvnTrHI82LgiabX6UH1QfXQhSAtq3AHWc4KIu/0HcZUYBgTalmpNlmsol7dgTpwMQPriwNdE65dc0ZeHUxY3cHNI+v5lXjSYlRBaoJnowY5qim4ld4hH2QGYNQ+GuzPXtCkBIbkG+uiADKrDyPVGOgjbC7To4BsKoIO2/0NkRCV0/G01kL393oWmhhIlk/OhhJZ5Z6QnC1EubX/e9n0lglbdXo7St8WjT4/3qtQ== wuzhiyi51@gmail.com
3,将SSHKey文件复制添加到GitHub上的SSH keys即可
标签:
原文地址:http://www.cnblogs.com/wuzhiyi/p/4645556.html