配置多个 GIT 账号

配置多个 GIT 账号

生成 SSH 公钥

生成第二以及后面多个 sshkey

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ ssh-keygen -t rsa -C "test@test.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxx/.ssh/id_rsa): /c/Users/xxx/.ssh/id_rsa_coding #此处需要手动输入路径及公钥文件名,比如加上 coding,以表示用于 coding.net
Enter passphrase (empty for no passphrase): #可缺省
Enter same passphrase again: #可缺省
Your identification has been saved in /c/Users/xxx/.ssh/id_rsa_coding.
Your public key has been saved in /c/Users/xxx/.ssh/id_rsa_coding.pub. #公钥文件
The key fingerprint is:
SHA256:zAj36q123456/123456h6g8XReRdbQPLA4Psz123456 xxxxx@xxxxx.com
The key's randomart image is:
+---[RSA 2048]----+
| |
| o o+..oo|
| |
| o.= o o .. |
| |
| o*=E = + . |
| |
| ... =.o |
| |
+----[SHA256]-----+

查看公钥内容:

1
$ cat ~/.ssh/id_rsa_coding.pub

Read More