mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Feature/rename known hosts (#72)
* * rename known-hosts to known_hosts * * update CI * * update README * * update CHANGELOG * * update README
This commit is contained in:
parent
aba3f4cae9
commit
326c0f5ec9
9 changed files with 19 additions and 18 deletions
14
README.md
14
README.md
|
@ -29,7 +29,7 @@ steps:
|
|||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa # optional
|
||||
known-hosts: ${{ secrets.KNOWN_HOSTS }} # known_hosts; optional
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
|
||||
config: ${{ secrets.CONFIG }} # ssh_config; optional
|
||||
- name: rsync over ssh
|
||||
run: rsync ./foo/ user@remote:bar/
|
||||
|
@ -42,7 +42,7 @@ See [Workflow syntax for GitHub Actions](https://help.github.com/en/articles/wor
|
|||
If you want to install multiple keys, call this action multiple times.
|
||||
It is useful for port forwarding.
|
||||
|
||||
**NOTE:** When this action is called multiple times, **the contents of `known-hosts` and `config` will be appended**. `key` must be saved as different name, by using `name` option.
|
||||
**NOTE:** When this action is called multiple times, **the contents of `known_hosts` and `config` will be appended**. `key` must be saved as different name, by using `name` option.
|
||||
|
||||
```yaml
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -52,7 +52,7 @@ steps:
|
|||
with:
|
||||
key: ${{ secrets.SSH_KEY_OF_BASTION }}
|
||||
name: id_rsa-bastion
|
||||
known-hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }}
|
||||
config: |
|
||||
Host bastion
|
||||
HostName xxx.xxx.xxx.xxx
|
||||
|
@ -63,7 +63,7 @@ steps:
|
|||
with:
|
||||
key: ${{ secrets.SSH_KEY_OF_TARGET }}
|
||||
name: id_rsa-target
|
||||
known-hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }} # will be appended!
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }} # will be appended!
|
||||
config: | # will be appended!
|
||||
Host target
|
||||
HostName yyy.yyy.yyy.yyy
|
||||
|
@ -84,9 +84,9 @@ Check belows:
|
|||
* OPENSSH format (key begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work.
|
||||
* Use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`).
|
||||
* `Host key verification failed.`:
|
||||
* Set `known-hosts` option or use `ssh -o StrictHostKeyChecking=no`.
|
||||
* Set `known_hosts` option or use `ssh -o StrictHostKeyChecking=no`.
|
||||
* The former is **HIGHLY** recommended for security reason.
|
||||
* I'm planning to make `known-hosts` required in v2.
|
||||
* I'm planning to make `known_hosts` required in v2.
|
||||
|
||||
### How do I use encrypted SSH key?
|
||||
|
||||
|
@ -104,7 +104,7 @@ I recommend **rsync via bastion**.
|
|||
It has some advantages over other methods:
|
||||
|
||||
* "Rsync via bastion" doesn't require to update workflow files and `secrets` even if it is necessary to transfer files to multiple servers.
|
||||
* Other methods require to update `known-hosts` if servers have changed.
|
||||
* Other methods require to update `known_hosts` if servers have changed.
|
||||
* Rsync:
|
||||
* is fastest of all.
|
||||
* does **NOT** break files even if disconnected during transferring.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue