标签:mon user nbsp 添加 rsa rgba entity highlight 本地
1 配置 github 公钥
ssh-keygen -t rsa -C "git@github.com"
2 Enter file in which to save the key (/home/fe/.ssh/id_rsa): 此时键入id_rsa.xxx 【xxx为文件后缀】
如果直接回车,则在~/.ssh/下,会生成 id_rsa(私钥)和id_rsa.pub(公钥) 如果输入id_rsa.xxx,则在~/.ssh/下生成为 id_rsa.xxx(私钥)和id_rsa.xxx.pub(公钥)
3 Enter passphrase (empty for no passphrase):以及 Enter same passphrase again: 都回车
4 重复步骤1-3,生成公私钥 id_rsa.zzz和id_rsa.pub
5 增加ssh配置文件
cd ~/.ssh touch config vim config
Host git@git.kangfuzi.com
HostName git@git.kangfuzi.com
User git
IdentityFile ~/.ssh/id_rsa.xxx
Host git@git.kangfuzi.com
HostName git@git.kangfuzi.com
User git
IdentityFile ~/.ssh/id_rsa.zzz
6 将 id_rsa.xxx和id_rsa.zzz 加入 本地 ssh
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa.xxx ssh-add ~/.ssh/id_rsa.zzz
7 设置config文件权限
chmod 600 config
8 最后将各个公钥分别添加至git上即可
标签:mon user nbsp 添加 rsa rgba entity highlight 本地
原文地址:https://www.cnblogs.com/drop-in-ocean/p/9020112.html