(1)生成并部署SSH key
打开git bash,输入以下命令生成 SSH Key
ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
(2)生成并部署第二个账号SSH key (id_rsa_github 为重命名)
ssh-keygen -t rsa -f ~/.ssh/id_rsa_github -C "xxx@xx.com"
(3) 将两个pub文件添加到对应的系统ssh中
(4)添加秘钥到SSH Agent
因为默认只读取id_rsa,为了让SSH识别新的私钥,需将其添加的SSH agent中。
ssh-agent bash
ssh-add ~/.ssh/id_rsa
ssh-add ~/.ssh/id_rsa_oschina