github how to delete old ssh key on my mac?

33,954

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 -

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

Share:
33,954
zeeone
Author by

zeeone

Updated on July 09, 2022

Comments

  • zeeone
    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.