今天小编就带大家来共同学习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
复制公钥内容到剪切板中。

以上就是小编给大家带来的全部内容,大家都学会了吗?
2024-11-11 15:11:21
2024-07-19 09:23:48
2024-06-14 09:12:32
2024-06-06 09:22:14
2024-02-29 09:14:13
2024-02-18 09:07:06
2023-11-15 09:22:09
2023-10-20 09:09:42
2023-10-09 09:10:43
2023-09-18 09:07:01