GIt@OSC SSH生成公钥公钥的流程
SSH key 可以让你在你的电脑和 Git @ OSC 之间建立安全的加密连接。
步骤如下:
$ cd ~/.ssh //进入.ssh文件
$ ls //查看文件
github_rsa github_rsa.pub known_hosts
$ ssh-keygen -t rsa -C “你的邮箱@XX.com" //来生成sshkey
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/XX/.ssh/id_rsa): //按回车
Enter passphrase (empty for no passphrase):
//需要添加密码,需要自己添加
Enter same passphrase again:
Your identification has been saved in /Users/XX/.ssh/id_rsa.
Your public key has been saved in /Users/XX/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:XXXX+XXXX 你的邮箱@XX.com
The key's randomart image is:
+---[RSA 2048]----+
| . |
| . . |
| . o. o . |
| *oo.. + + . |
|. ..+X.oS= o . . |
|.. o=.B . = . E |
|. . =.o .+ . |
|. . ..+.o...o |
|*+ =+o.+o. |
+----[SHA256]-----+
验证是否配置成功
$ cat ~/.ssh/id_rsa.pub
ssh-rsa xxxxxxxxxx 你的邮箱@XX.com
$ ssh -T git@git.oschina.net
The authenticity of host 'git.oschina.net (IP)’ can't be established.
Are you sure you want to continue connecting (yes/no)? yes
XXXX
Welcome to Git@OSC, XXXX! //添加成功