GIt@OSC SSH生成公鑰公鑰的流程
SSH key 可以讓你在你的電腦和 Git @ OSC 之間建立安全的加密連接。
步驟如下:
$ cd ~/.ssh? ? ? //進(jìn)入.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! //添加成功