Done!

Key Already in use in Git Hub & Bit Bucket


In GitHub & BitBucket account when you add the new ssh key after deleting the old one, it still gives annoying "Key Already in Use" message - preventing user from adding the newly generated key. The way around to this is to generate another public key on your local machine and add it to your GitHub or BitBucket account, as shown on the step below:

1. Generate new public key

> ssh-keygen -f ~/.ssh/personal
// It will generate personal.pub(public) and personal (private) keys

2. Copy this new key

> cat ~/.ssh/personal.pub | xclip -sel clip

3. Add this copied public key on ssh section of your GitHub or BitBucket Account

4. On Local computer, generate .ssh/config file

> cd ~/.ssh
> touch config

5. Set up the .ssh/config path with following block of configuration:

# Default GitHub
Host github.com
HostName github.com
User rajsamv 
IdentityFile ~/.ssh/id_rsa 

#Specify Git Hub to use the Newely Generated
Host github-personal
HostName github.com
User samvuWeb123 
IdentityFile ~/.ssh/personal 

5. Next, you will need to alter your .git/config remote url to point to:

// Modify To:
git@github-personal:samvuWeb123/EasyTyping123.git

//INSTEAD OF:
[email protected]:samvuWeb123/EasyTyping123.git

Thank you

Source:
1. https://stackoverflow.com/questions/21160774/github-error-key-already-in-use
2. https://stackoverflow.com/questions/2419566/best-way-to-use-multiple-ssh-private-keys-on-one-client