Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The RSA host key for github.com has changed #525

Closed
uchar opened this issue Mar 26, 2023 · 3 comments
Closed

The RSA host key for github.com has changed #525

uchar opened this issue Mar 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@uchar
Copy link

uchar commented Mar 26, 2023

Recently when I'm trying to reference a private GitHub repository in the manifest.json , I get this error :

@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    The RSA host key for github.com has changed,
    and the key for the corresponding IP address 140.82.114.4
    is unknown. This could either mean that
    DNS SPOOFING is happening or the IP address for the host
    and its host key have changed at the same time.
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
    Please contact your system administrator.
    Add correct host key in /root/.ssh/known_hosts to get rid of this message.
    Offending DSA key in /root/.ssh/known_hosts:4
      remove with:
      ssh-keygen -f "/root/.ssh/known_hosts" -R "github.com"
    RSA host key for github.com has changed and you have requested strict checking.
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

My config:

      - uses: webfactory/ssh-agent@v0.5.2
        with:
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
      - uses: game-ci/unity-builder@v2
        env:
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
          UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
        with:
          versioning: Custom
          version: ${{ github.event.inputs.buildVersion }}
          targetPlatform: Android
          androidAppBundle: true
          androidKeystoreName: user.keystore
          androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
          androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
          androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
          androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
          allowDirtyBuild: true
          sshAgent: ${{ env.SSH_AUTH_SOCK }}

I also recreate secrets.SSH_PRIVATE_KEY but it doesn't fix the problem
It seems to be related to this issue
Does anyone else have this problem?

@uchar uchar added the bug Something isn't working label Mar 26, 2023
@uchar uchar changed the title The RSA host key for github.com has changed, The RSA host key for github.com has changed Mar 26, 2023
@uchar
Copy link
Author

uchar commented Mar 27, 2023

I updated webfactory/ssh-agent to the latest version and this fixed this problem but now I get another error

Error when executing git command. ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

@uchar uchar closed this as completed Mar 27, 2023
@uchar uchar reopened this Mar 27, 2023
@philip-futureverse
Copy link

I'm having the exact same issue

@uchar
Copy link
Author

uchar commented Mar 28, 2023

@philip-alteredphoenix I fixed the problem by adding GitHub to known hosts manually :

- name: "Add GitHub to the SSH known hosts file"
  run: |
    mkdir -p -m 0700 /home/runner/.ssh
    curl --silent https://api.github.com/meta  | jq --raw-output '"github.com "+.ssh_keys[]' >> /home/runner/.ssh/known_hosts
    chmod 600 /home/runner/.ssh/known_hosts

@uchar uchar closed this as completed Mar 31, 2023
uchar added a commit to uchar/documentation that referenced this issue Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants