github how to delete old ssh key on my mac?
Solution 1
What i had to do is -
Open terminal
cd ~/.ssh
open .
Then folder opened in finder then i removed id_***.pub (SSH key files). Then followed following instructions -
- In Finder, search for the Keychain Access app.
- In Keychain Access, search for github.com.
- GitHub Password Entry in KeychainFind the "internet password" entry for github.com.
-
Edit or delete the entry accordingly.
https://help.github.com/articles/updating-credentials-from-the-osx-keychain/
Hope that helps!
Solution 2
Usually in OS X
ssh keys are stored in:
~/.ssh
If you need to remove one of them:
rm keyname_rsa
Solution 3
- You should change the global configuration of git.
$ git config --global user.name "Your Name"
$ git config --global user.email [email protected]
- Add the ssh key of into your github account.
- Copy and paste the output of this
cat .ssh/id_rsa.pub
P.S : I am assuming the public keys are stored into id_rsa.pub
zeeone
Updated on July 09, 2022Comments
-
zeeone almost 2 years
Hi I recently purchased a used mac for development, however when I try to push code from my mac to my github repository. I will be getting this error:Permission to myself/testuser.git denied to oldmacowner for example.
I am wondering how to go about this. I think I need to delete the old ssh key that belongs to the oldmacuser and set up a new ssh key from github. Anyone have an idea of how to go about it? Thanks.