ssh-action@master fails with RSA key: invalid CRT coefficient
- Dominant language
- Go
- Stars
- 314
- Forks
- 79
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
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:
```yaml
- 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the GitHub Actions workflow with the RSA private key from the issue on appleboy/ssh-action@master, then compare its behavior with v1.2.3. Trace the handling of the private key and the reported invalid CRT coefficient; done means the master version authenticates successfully without requiring a downgrade.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, go
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100