Error “The authenticity of host 'github.com' can't be established. RSA key fingerprint ”

前端 未结 4 1484
梦毁少年i
梦毁少年i 2021-02-19 04:00

I use my project at work, but I would like to work with him from home as I can log into my home machine to work with my project.

However, from home, I see the following

4条回答
  •  孤街浪徒
    2021-02-19 04:35

    Try these steps:

    Open Git Bash

    Check for existing SSH keys:

    $ ls -al ~/.ssh

    If you already have them, you will see:

    id_rsa.pub

    id_ecdsa.pub

    id_ed25519.pub

    If you don't, generate one (Press Enter to accept the default file location):

    $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

    To copy the key to clipboard:

    $ clip < ~/.ssh/id_rsa.pub

    Go to your account on Github/Settings/SSH and GPG keys/New SSH key

    Paste your key there

    Next, type:

    $ git remote

    If you see origin, remove it:

    $ git remote remove origin

    Continue with the last 2 steps provided on GitHub repo page...

    $ git remote add origin git@github.com:USERNAME/REPONAME.git

    $ git push -u origin master

    Refresh your GitHub repo page

    Voila!

提交回复
热议问题