Skip to content

The id_rsa.pub that is created in Github Actions conflicts with the id_rsa causing SSH_KEY to be denied #8808

@euanmillar

Description

@euanmillar

Describe the bug
A new issue has been discovered that hasnt happened before when running provision and deploy actions.

Recently the SSH_KEY receives permission denied errors.

After debugging we discovered that the Github runner already has a .ssh folder with an id_rsa.pub inside it. The shimataro/ssh-key-action@v2 only creates an id_rsa.

When SSH is used, the agent runs checks to make sure that the permissions and ownership of the .ssh folder are correct. Unnecessarily it also checks if there is an id_rsa.pub and if it corresponds to the id_rsa even though the id_rsa.pub is never going to be used in the subsequent SSH connection.

As a result the keys do not match and we get permission denied.

OpenCRVS Core Version:

  • v1.6.2 (Git branch: master / release-v1.6.2)

Country Configuration Version:

  • v1.6.2 (Git branch: master / release-v1.6.2)

Possible fixes
(If you can, link to the line of code that might be responsible for the problem)

After the "Install SSH Key" in all the workflows, a step can be added to delete any id_rsa.pub file that exists in the .ssh folder. When we deleted this id_rsa.pub, the workflow proceeded.

      - name: Delete public key
        run: rm -f ~/.ssh/id_rsa.pub

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions