Virtual-environments: SSH host key validation failed on OSX but succeeded on Linux when checking out a repository from `ssh://github.com`

Created on 22 Apr 2020  路  4Comments  路  Source: actions/virtual-environments

Describe the bug
SSH host key validation failed on OSX but succeeded on Linux when checking out a repository from ssh://github.com

Area for Triage:

Question, Bug, or Feature?:

Virtual environments affected

  • [x] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [ ] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Expected behavior
The same behaviour on both OSX and Linux. Either both fail or neither.

Actual behavior

The following workflow succeeded on Linux with a warning message during the checkout phase indicating that the host key of github.com was added . On OSX it failed with a Host key verification failed error message. This suggests to me that SSH is configured to be more tolerant on Linux but not on OSX.

    steps:
    - name: Configure SSH
      shell: bash
      run: |
        mkdir -p ~/.ssh
        echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa      
        chmod 600 ~/.ssh/id_rsa
    - uses: actions/checkout@v1
      with:
        submodules: recursive

The issue is easily worked around by adding ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts to the Configure SSH step. However, it would be good if SSH was configured as consistently as possible across the different environments. Perhaps we could even add github.com to the known hosts file in the image.

Scripting and command line Ubuntu macOS

All 4 comments

Hello, pull request was merged. Changes would be added in the next images rollout.

Great, thanks!

@aibaars the image with changes has been deployed. Could you check the behavior, please?

It works for me, thanks!

Was this page helpful?
0 / 5 - 0 ratings