Here is how the step to resolve it.
After id_rsa and id_rsa.pub is used to assigned account A. For account B, I need to create another set of public and private key.
$ssh-keygen -t dsa -f ~/.ssh/newaccB -C ""
$chmod 600 ~/.ssh/newaccB*
$ssh-add ~/.ssh/newaccB
After that you need to go to ~/.ssh/config to give ssh client further instruction when connect to the same bitbucket.org server but knowing when to use which private key.
Host bitbucket.org
Hostname bitbucket.org
User git
IdentityFile /Users//.ssh/id_rsa
Host bitbucket-accountB
Hostname bitbucket.org
User git
IdentityFile /Users//.ssh/newaccB
So, after setting up when you want to use the account B key, you need to change the url to something such as below:
$git clone git@bitbucket-accountB:/.git
For account A, you still can use the original ssh url to do so.
If you are using SmartGit, better to choose the System SSH in your preference. If not, you will still getting error.
PS: ssh-add ~/.ssh/newaccB might be adding behind after modify ~/.ssh/config
reference : http://paikialog.wordpress.com/2011/10/14/how-to-set-bitbucket-for-multiple-accounts/
沒有留言:
張貼留言