今天小编就带大家来共同学习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-06-06 09:24:21
2024-05-16 10:24:40
2024-03-15 12:00:53
2024-03-06 14:12:52
2024-02-19 09:11:41
2024-01-29 09:21:31
2023-11-21 09:30:44
2023-11-17 09:22:34
2023-11-13 09:23:22
2023-09-15 09:05:37