sourceTree添加使用SSH密钥的处理方法

  • A+
所属分类:减隔震百科

今天小编就带大家来共同学习sourceTree添加及使用SSH密钥?希望可以帮助到有需要的小伙伴哦,下面就是详细完整的操作步骤。

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

复制公钥内容到剪切板中。

sourceTree添加使用SSH密钥的处理方法

以上就是小编给大家带来的全部内容,大家都学会了吗?

大家都在看:

广告也精彩
kdmin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: