From 6c5771fab80636a8a00ed22021dc4c3319184de0 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 20 Jan 2020 23:07:25 +0800 Subject: [PATCH] chore: Add passphrase --- README.md | 16 ++++++++++++++++ action.yml | 2 ++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index f10bedb..7cebfae 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ see the [action.yml](./action.yml) file for more detail imformation. * port - scp remote port, default is `22` * username - scp username * password - scp password +* passphrase - the passphrase is usually to encrypt the private key * timeout - timeout for ssh to remote host, default is `30s` * command_timeout - timeout for scp command, default is `10m` * key - content of ssh private key. ex raw content of ~/.ssh/id_rsa @@ -141,3 +142,18 @@ foobar ├── a.txt └── b.txt ``` + +Protecting a Private Key. The purpose of the passphrase is usually to encrypt the private key. This makes the key file by itself useless to an attacker. It is not uncommon for files to leak from backups or decommissioned hardware, and hackers commonly exfiltrate files from compromised systems. + +```diff + - name: ssh key with passphrase + uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH2 }} ++ passphrase: ${{ secrets.PASSPHRASE }} + port: ${{ secrets.PORT }} + source: "tests/a.txt,tests/b.txt" + target: "test" +``` diff --git a/action.yml b/action.yml index 385c384..1c5afeb 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,8 @@ inputs: description: 'content of ssh private key. ex raw content of ~/.ssh/id_rsa' key_path: description: 'path of ssh private key' + passphrase: + description: 'ssh key passphrase' target: description: 'target path on the server' source: