git 给某个仓库单独配置SSH KEY

使用背景

服务器A上大家都是统一的账号密码,这时候要区分不同人的话,需要

  1. 每个人在A上生成自己ssh 密钥,(也可以用自己其他平台上已有的公钥私钥代替)其中私钥自己保存,公钥上传到需要连接的服务器B上

  2. 在自己的仓库中,运行git config core.sshCommand “ssh -i ~/.ssh/id_rsa_personal -F /dev/null” 配置此仓库的ssh访问密钥

  3. 在自己的仓库中 git config user.name “Your Name” git config user.email “yourname@zoom.us