You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -33,24 +33,24 @@ jobs:
33
33
...
34
34
steps:
35
35
- actions/checkout@v2
36
-
# Make sure the @v0.4.1 matches the current version of the
36
+
# Make sure the @v0.5.0 matches the current version of the
37
37
# action
38
-
- uses: webfactory/ssh-agent@v0.4.1
38
+
- uses: webfactory/ssh-agent@v0.5.0
39
39
with:
40
40
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
41
41
- ... other steps
42
42
```
43
43
5. If, for some reason, you need to change the location of the SSH agent socket, you can use the `ssh-auth-sock` input to provide a path.
44
44
45
-
### Using multiple keys
45
+
### Using Multiple Keys
46
46
47
47
There are cases where you might need to use multiple keys. For example, "[deploy keys](https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys)" might be limited to a single repository, so you'll need several of them.
48
48
49
49
You can set up different keys as different secrets and pass them all to the action like so:
50
50
51
51
```yaml
52
52
# ... contens as before
53
-
- uses: webfactory/ssh-agent@v0.4.1
53
+
- uses: webfactory/ssh-agent@v0.5.0
54
54
with:
55
55
ssh-private-key: |
56
56
${{ secrets.FIRST_KEY }}
@@ -78,13 +78,13 @@ The action exports the `SSH_AUTH_SOCK` and `SSH_AGENT_PID` environment variables
78
78
The `$SSH_AUTH_SOCK` is used by several applications like git or rsync to connect to the SSH authentication agent.
79
79
The `$SSH_AGENT_PID` contains the process id of the agent. This is used to kill the agent in post job action.
80
80
81
-
## Known issues and limitations
81
+
## Known Issues and Limitations
82
82
83
-
### Works for the current job only
83
+
### Works for the Current Job Only
84
84
85
85
Since each job [runs in a fresh instance](https://help.github.com/en/articles/about-github-actions#job) of the virtual environment, the SSH key will only be available in the job where this action has been referenced. You can, of course, add the action in multiple jobs or even workflows. All instances can use the same `SSH_PRIVATE_KEY` secret.
86
86
87
-
### SSH private key format
87
+
### SSH Private Key Format
88
88
89
89
If the private key is not in the `PEM` format, you will see an `Error loading key "(stdin)": invalid format` message.
90
90
@@ -94,21 +94,21 @@ Use `ssh-keygen -p -f path/to/your/key -m pem` to convert your key file to `PEM`
94
94
95
95
The following items are not issues, but beyond what this Action is supposed to do.
96
96
97
-
### Work on remote machines
97
+
### Work on Remote Machines
98
98
99
99
When using `ssh` to connect from the GitHub Action worker node to another machine, you *can* forward the SSH Agent socket and use your private key on the other (remote) machine. However, this Action will not configure `known_hosts` or other SSH settings on the remote machine for you.
100
100
101
-
### Provide the SSH key as a file
101
+
### Provide the SSH Key as a File
102
102
103
103
This Action is designed to pass the SSH key directly into `ssh-agent`; that is, the key is available in memory on the GitHub Action worker node, but never written to disk. As a consequence, you _cannot_ pass the key as a build argument or a mounted file into Docker containers that you build or run on the worker node. You _can_, however, mount the `ssh-agent` Unix socket into a Docker container that you _run_, set up the `SSH_AUTH_SOCK` env var and then use SSH from within the container (see #11).
104
104
105
-
### Run `ssh-keyscan` to add host keys for additional hosts
105
+
### Run `ssh-keyscan` to Add Host Keys for Additional Hosts
106
106
107
107
If you want to use `ssh-keyscan` to add additional hosts (that you own/know) to the `known_hosts` file, you can do so with a single shell line in your Action definition. You don't really need this Action to do this for you.
108
108
109
109
As a side note, using `ssh-keyscan` without proper key verification is susceptible to man-in-the-middle attacks. You might prefer putting your _known_ SSH host key in your own Action files to add it to the `known_hosts` file. The SSH host key is not secret and can safely be committed into the repo.
110
110
111
-
## Creating SSH keys
111
+
## Creating SSH Keys
112
112
113
113
In order to create a new SSH key, run `ssh-keygen -t ed25519 -a 100 -f path/to/keyfile`, as suggested in [this blog post](https://stribika.github.io/2015/01/04/secure-secure-shell.html).
114
114
If you need to work with some older server software and need RSA keys, tr `ssh-keygen -t rsa -b 4096 -o -f path/to/keyfile` instead.
@@ -117,7 +117,7 @@ Both commands will prompt you for a key passphrase and save the key in `path/to/
117
117
In general, having a passphrase is a good thing, since it will keep the key encrypted on your disk. When using the key with this action, however, you need to make sure you don't
118
118
specify a passphrase: The key must be usable without reading the passphrase from input. Since the key itself is stored using GitHub's "Secret" feature, it should be fairly safe anyway.
119
119
120
-
## Authorizing a key
120
+
## Authorizing a Key
121
121
122
122
To actually grant the SSH key access, you can – on GitHub – use at least two ways:
0 commit comments