今天小编就带大家来共同学习 sourceTree 添加及使用 SSH 密钥? 希望可以帮助到有需要的小伙伴哦,下面就是详细完整的操作步骤。
sourceTree 添加使用 SSH 密钥的处理方法
1、打开命令行窗口 Terminal
$ ssh-keygen -t rsa -b 4096 -C “your_email@example.com”
此时在用户目录下生成 ssh 公钥及对应密钥
~/.ssh/id_rsa 及~/.ssh/id_rsa.pub
如果 mac 系统是 10.12.2 及以上,需要更改~/.ssh/config 文件配置
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
3 添加本地生成的 ssh 私钥到 ssh-agent
ssh-add -K 本地私钥路径地址
4 在你需要 clone 的系统中,添加用户的 ssh 公钥
pbcopy < ~/.ssh/id_rsa.pub
复制公钥内容到剪切板中。
以上就是小编给大家带来的全部内容,大家都学会了吗?
正文完