Git配置多个服务器
mkdir -p ~/.ssh cd ~/.ssh/ ssh-keygen -t rsa -C "[email protected]" # 把这个文件命名为id_rsa_xiaomi,然后一路回车 ssh-keygen -t rsa -C "[email protected]" # 把这个文件命名为id_rsa_github,然后一路回车 # 此时在~/.ssh下面生成两对公私钥 touch config chmod 600 ~/.ssh/* #config中添加下面内容: host git.n.xiaomi.com user git hostname git.n.xiaomi.com port 22 identityfile ~/.ssh/id_rsa_xiaomi host github.com user git hostname github.com port 22 identityfile ~/.ssh/id_rsa_github # cat ~/.ssh/id_rsa_xiaomi.pub的内容贴到xiaomi的ssh keys中 # cat ~/.ssh/id_rsa_github.pub的内容贴到github的ssh keys中
相关推荐
  hulao    2020-06-12  
   projava    2020-11-14  
   WanKaShing    2020-11-12  
   airfish000    2020-09-11  
   tryfind    2020-09-14  
   yegen00    2020-09-10  
   kkaazz    2020-09-03  
   风语者    2020-09-02  
   BraveWangDev    2020-08-19  
   lichuanlong00    2020-08-15  
   gsl    2020-08-15  
   pandaphinex    2020-08-09  
   yhuihon    2020-08-09  
   CheNorton    2020-08-02  
   xiangqiao    2020-07-28  
   hpujsj    2020-07-26  
   hpujsj    2020-07-26  
   sshong    2020-07-19  
   BraveWangDev    2020-07-19  
 