BitBucket does not allow the same key to be used for two different accounts. Security measure, I'm sure. It does make it difficult to access my company account and my personal account from the same machine.
The workaround is to do the initial download via https, then change the protocol. More specifically....
Setup:
Assuming 'WORK' and 'HOME' are two separate BitBucket accounts and you are using a single client (laptop, whatever) to access them both... Decide which one should be less effort -- in this case, I chose WORK.1. Create an SSH key for WORK
Choose the default /home/username/.ssh/id_rsassh-keygen
2. Copy id_rsa.pub into your BitBucket WORK account
3. Create an SSH key for HOME
Choose /home/username/.ssh/id_personal_rsa or something else obviousssh-keygen
4. Copy id_personal_rsa.pub into your BitBucket HOME account
The Good:
For WORK repos, you can simply do the normalhg clone ssh://hg@bitbucket.org/WORK/REPO
The Ok, I Guess:
For HOME repos, you have to take an extra step.hg clone https://USERNAME@bitbucket.org/USERNAME/REPO
Then, edit REPO/.hg/hgrc
Change
todefault = hg clone https://USERNAME@bitbucket.org/USERNAME/REPO
default = hg clone ssh://hg@bitbucket.org/USERNAME/REPO
Then, add this into that file:
[ui]
ssh = ssh -C -i ~/.ssh/id_personal_rsa.pub -o IdentitiesOnly=yes
Now you should be able to push/pull using SSH.
this seems to be the easiest way for git
ReplyDeleteSimple PHP File Cache
ReplyDeleteCreate Dynamic Pie Chart using Google API
Driving route directions
CSS Simple Menu Navigation Bar
jQuery loop over JSON result
PHP MYSQL Advanced Search Feature
Simple Show Hide Menu Navigation
NodeJS Simple way to send SMTP mail
Simple pagination in PHP
Date Timestamp Formats in PHP
jQuery ready() Event
ReplyDeletejQuery scroll() Event
jQuery resize() Event
jQuery submit() Event
jQuery addClass() Attribute
jQuery Attr Attribute
jQuery hasClass() Attribute
jQuery HTML attribute
PHP Logging Errors Into a File
ReplyDeletePHP SplFileObject Standard Library
PHP7 Sodium Encryption Decryption
PHP7 Password Hashing
PHP7.3 New Features
PHP Get Visitor Information
PHP secure random password
PHP Graphics