ssh-agent icon indicating copy to clipboard operation
ssh-agent copied to clipboard

Host key verification failed on Windows on 0.9.0

Open xanather opened this issue 1 year ago • 11 comments

See https://github.com/webfactory/ssh-agent/pull/17#issuecomment-1798849240

Creating an actual issue to track this rather than people commenting on that PR.

Downgrading does fix the issue, but since nodeJS 16 is being deprecated in GitHub actions it may no longer be a workaround in the future.

xanather avatar Jun 05 '24 01:06 xanather

I hit this issue too with a docker based workflow, downgrading to 0.7.0 sorted it for me too

ReFil avatar Jun 05 '24 12:06 ReFil

Same boat here - we're using 0.6.0 for now as it's stable as 0.8.0 didn't work, but keen to see once this is working on node 20. Thanks for the support here!

TheDuckCow avatar Jun 12 '24 16:06 TheDuckCow

Same for me on windows node with 0.9.0

krotz-dieter avatar Jun 18 '24 13:06 krotz-dieter

same for me on windows

MoustaphaSaad avatar Jul 06 '24 20:07 MoustaphaSaad

Can we have updates on it ?

Waxo avatar Aug 28 '24 07:08 Waxo

As this is yet to be resolved, I found a workaround by adding github.com ssh key to known_hosts file:

      - name: Configure SSH agent
        uses: webfactory/[email protected]
        with:
          ssh-private-key: ${{ YOUR_SECRET_KEY }}

      - name: Add GitHub to the SSH known hosts file
        run: |
          curl -L -o jq.exe https://github.com/jqlang/jq/releases/latest/download/jq-win64.exe
          curl --silent https://api.github.com/meta | jq --raw-output "\"github.com \"+.ssh_keys[]" >> %USERPROFILE%/.ssh/known_hosts

tzuriel-spearuav avatar Sep 05 '24 08:09 tzuriel-spearuav

This PR (https://github.com/webfactory/ssh-agent/pull/186) is close to @tzuriel-spearuav fix

Waxo avatar Sep 05 '24 16:09 Waxo

Don't know, last commit is 10 month ago. In my case just moved to a better rounded solution instead of some ssh shortcut and tricks. Good luck mate ¯_(ツ)_/¯

Waxo avatar Dec 04 '24 14:12 Waxo

@Waxo What was the better solution?

mmerlo avatar Apr 29 '25 17:04 mmerlo

In my case I was using github for dart/flutter dependencies, we just swap to a paid private repository. Not sure if applicable for you.

Waxo avatar Apr 30 '25 09:04 Waxo

@tzuriel-spearuav Thanks for the tip! Your snippet didn't work for me as is though but I was able to make it work with small modifications. This is what worked for me:

#...
jobs:
  my_job:
    runs-on: windows-latest
    steps:

      - name: Configure SSH agent
        uses: webfactory/[email protected]
        with:
          ssh-private-key: ${{ secrets.YOUR_SECRET_KEY }}

      - name: Add GitHub to the SSH known hosts file
        shell: bash
        run: |
          curl -L -o jq.exe https://github.com/jqlang/jq/releases/latest/download/jq-win64.exe
          mkdir -p $HOME/.ssh
          curl --silent https://api.github.com/meta | jq --raw-output '"github.com "+.ssh_keys[]' >> $HOME/.ssh/known_hosts
#...

Haprog avatar Oct 27 '25 21:10 Haprog