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.
When running a GitHub Actions workflow using appleboy/ssh-action@master, the SSH connection fails with the following error:
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:
Once I downgraded to:
appleboy/ssh-action@v1.2.3the problem was resolved.