ssh bitbucket github

$ ssh-keygen -t rsa -C "mac"

$ vi ~/.ssh/config
Host bb
User          git
HostName      bitbucket.org
IdentityFile  ~/.ssh/id_rsa

假设是github,则
Host github
User git
HostName github.com
IdentityFile ~/.ssh/id_rsa

$ chmod 600 ~/.ssh/config
$ chmod 600 ~/.ssh/id_rsa

在bitbucket.org加入public key

$ ssh bb
You can use git or hg to connect to Bitbucket. Shell access is disabled.
Connection to bitbucket.org closed.

假设是github,则
$ ssh github

$ git clone git@bitbucket.org:...

原文地址:https://www.cnblogs.com/yjbjingcha/p/6863272.html