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

前端 未结 19 959
迷失自我
迷失自我 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:38

    I was facing the same error inside DockerFile during build time while the image was public. I did little modification in Dockerfile.

     RUN git clone  https://github.com/kacole2/express-node-mongo-skeleton.git /www/nodejs
    

    This would be because using the git@github.com:... syntax ends up > using SSH to clone, and inside the container, your private key is not > available. You'll want to use RUN git clone > https://github.com/edenhill/librdkafka.git instead.

    0 讨论(0)
  • 2020-11-22 12:39

    For me, I just had to type "yes" at the prompt which asks "Are you sure you want to continue connecting (yes/no)?" rather than just pressing Enter.

    0 讨论(0)
  • 2020-11-22 12:39

    When asked:

    Are you sure you want to continue connecting (yes/no)?

    Type yes as the response

    That is how I solved my issue. But if you try to just hit the enter button, it won't work!

    0 讨论(0)
  • 2020-11-22 12:39

    You can use your "git url" in 'https" URL format in the Jenkinsfile or wherever you want.

    git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'

    0 讨论(0)
  • 2020-11-22 12:39

    You kan use https instead of ssh for git clone or git pull or git push

    ex:

    git clone https://github.com/user/repo.git
    
    0 讨论(0)
  • 2020-11-22 12:40

    If you are in office intranet (otherwise dangerous) which is always protected by firewalls simply have the following lines in your ~/.ssh/config.

    Host *
      StrictHostKeyChecking no
      UserKnownHostsFile=/dev/null
    
    0 讨论(0)
提交回复
热议问题