命令行 ssh-keygen -t rsa -C "***@gmail.com" ,生产公私钥
分别在github 上把公钥,配置好,github 不同账户,不能共享一个公钥。
![](https://img.haomeiwen.com/i5252436/02c203ba15821f8d.png)
git 配置设置
vi ~/.ssh/config
配置文件里面,配置2个账户,不同的key
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa //私有 key
Host github2.com //别名
HostName github.com // 真实地址
IdentityFile ~/.ssh/id_ed25519 //私有 key
测试是否正常
$ ssh -Tv git@github2.com
Hi ***! You've successfully authenticated, but GitHub does not provide shell access.
网友评论