美文网首页
git多用户配置ssh key

git多用户配置ssh key

作者: getsu | 来源:发表于2019-02-15 15:44 被阅读0次
  1. ssh key 生成
ssh-keygen -t rsa -C "your@mail.com" -b 4096
  1. copy后贴到github或者gitlab,copy命令如下例:
  • Mac
pbcopy < ~/.ssh/github_rsa.pub
  • Linux
xclip -sel clip < ~/.ssh/github_rsa.pub
  1. 配置ssh config,配置文件位于~/.ssh/config。内容如下
Host github.com
   User getsu
   Hostname github.com
   IdentityFile ~/.ssh/github_rsa

Host gitlab.com
   User getsu
   Hostname gitlab.com
   IdentityFile ~/.ssh/gitlab_rsa

相关文章

网友评论

      本文标题:git多用户配置ssh key

      本文链接:https://www.haomeiwen.com/subject/pufmeqtx.html