Description
ssh-agent is a GitHub Action that starts ssh-agent in a workflow, exports the SSH_AUTH_SOCK variable, and loads one or more private SSH keys into the agent. Once the keys are loaded, git clone with SSH URLs and ssh commands to other servers work in the workflow without extra setup. The README explains the reason for it. A GitHub Actions job only has access to the repository it runs for, so to fetch libraries or vendored code from other private repositories you create a dedicated SSH key, add its public part to the other repository as a deploy key, and store the private key as a secret. This action then makes that key available in the job. The README says it should work in all GitHub Actions virtual environments, including container-based workflows, and it notes that Windows and Docker support is newer and has had less feedback. You can load several deploy keys, which the action maps to repositories using the comments in each key. The socket location can be changed with the ssh-auth-sock input. The README advises using a dedicated key instead of a personal one, and says the private key must not have a passphrase. The action is used as one step in a workflow, usually placed near the checkout step.…
Highlights
- Starts ssh-agent and loads private keys in a workflow
- Lets git clone over SSH work in CI
- Supports multiple GitHub deploy keys
- Works in container-based workflows
- Configurable agent socket path
Ratings & Reviews
No ratings yet
Be the first to rate SSH Agent.
People also visit
SSH Agent FAQ
What does this action do?
It starts ssh-agent in a GitHub Actions job and loads the private SSH keys you provide, so SSH connections work in the job.
Why would I need it?
A workflow can only access its own repository by default. This action lets it use a deploy key to clone other private repositories or connect to servers.
Can I use more than one key?
Yes. Several deploy keys can be loaded, and the action maps each one to its repository using the key's comment.
Does the key need a passphrase?
The README says the private key must not have a passphrase.
Does it work on Windows and in Docker?
The README says it should work everywhere GitHub Actions runs, but Windows and Docker support is newer and has had less feedback.
What are the best SSH Agent alternatives?
Popular alternatives to SSH Agent include SSH Action, Github Keygen and Github Pages Deploy Action. See all SSH Agent alternatives





