Skip to content

ssh-action@master fails with RSA key: invalid CRT coefficient #294

@kangwonchul

Description

@kangwonchul

When running a GitHub Actions workflow using appleboy/ssh-action@master, the SSH connection fails with the following error:

2025/12/02 05:42:09 ssh.ParsePrivateKey: crypto/rsa: invalid CRT coefficient
2025/12/02 05:42:10 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
Error: Process completed with exit code 1.

This happened consistently when attempting to connect to an EC2 instance using an RSA private key stored in GitHub Secrets.

Workflow Configuration

Here is the step that caused the failure:

- name: server connect
  uses: appleboy/ssh-action@master
  with:
    host: ${{ secrets.TEST_SERVER_HOST }}
    username: ec2-user
    key: ${{ secrets.PRIVATE_KEY }}
    timeout: 60s
    port: 22

Once I downgraded to: appleboy/ssh-action@v1.2.3 the problem was resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions