DEV Community

Gahyun
Gahyun

Posted on

When Push command don't work after factory reset

I factory reset Mac. I back up whole files. But when I tried to push my github repository, it didn't work. The reason was ssh-key wasn't in my mac. So I have to create new ssh-key.

Here is what I got a error message.

git push
The authenticity of host 'github.com ()' can't be established.
ED______ key fingerprint is SHA236:+_____/______.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED______) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Enter fullscreen mode Exit fullscreen mode

You can recognize how to solve this problem at 'Could not read from remote repository'.

I write steps what you can.

  1. Check SSH-KEY in mac
    ls -al ~/.ssh
    If there isn't id_rsa ~ file, you don't have ssh-key yet.

  2. Generate SSH-KEY

  3. Add it to the ssh-agent (you can find easily how to add on your github account)

  4. Retry Push command
    It will successful!

Top comments (0)