SyntaxHighlighter

Monday, July 18, 2016

git Permission Denied after reboot

Common issue that I just dealt with again, but wanted to write it down for that time I won't have it memorized.

My machine's git account is tied to the rsa key for github. Company switched to Bitbucket, I created another key to keep the accounts separate, and now whenever I restart my machine git gives me an error like:
Permission denied (publickey).fatal: Could not read from remote repository.
Please make sure you have the correct access rightsand the repository exists.


Turns out I need to add the new key to ssh because it loses track. Some folks have suggested putting this in their bashrc so they don't need to type, but I don't restart the machine too often and typed this post instead.

ssh-add ~/.ssh/id_rsabb

The rsa key is in the .ssh directory, but needed to be added to the console. "id_rsabb" was the name I chose for my bitbucket rsa key. Simple command, enter my key's password, and git + ssh are working together again. 

No comments:

Post a Comment