Git error: “Host Key Verification Failed” when connecting to remote repository

前端 未结 19 990
迷失自我
迷失自我 2020-11-22 11:40

I am trying to connect to a remote Git repository that resides on my web server and clone it to my machine.

I am using the following format for my command:



        
19条回答
  •  忘了有多久
    2020-11-22 12:17

    I had the similar issue, but, using SSH keys. From Tupy's answer, above, I figured out that the issue is with known_hosts file not being present or github.com not being present in the list of known hosts. Here are the steps I followed to resolve it -

    1. mkdir -p ~/.ssh
    2. ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
    3. ssh-keygen -t rsa -C "user.email"
    4. open the public key with this command $ cat ~/.ssh/id_rsa.pub and copy it.
    5. Add the id_rsa.pub key to SSH keys list on your GitHub profile.

提交回复
热议问题