Git SSH 密钥多个 Git 来源

1. 生成 SSH 密钥

ssh-keygen -t rsa -b 4096 -C "[email protected]"

2. 输入指定路径

Git SSH 密钥多个 Git 来源_第1张图片

3. 增加 config文件在.ssh文件下

# GitHub 主账户
Host github.dis.com
    HostName github.disney.com
    User git
    IdentityFile ~/.ssh/id_rsa


# 其他 Git 服务器
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/997959066

4.测试连接

ssh -T [email protected]

你可能感兴趣的:(git,ssh,运维)