Copy Private Key content and paste in Github Secrets.
Copy Private Key content and paste in Github Secrets.
<details>
<summary>rsa</summary>
<p>
```bash
```bash
clip < ~/.ssh/id_rsa
clip < ~/.ssh/id_rsa
```
```
</p>
</details>
<details>
<summary>ed25519</summary>
<p>
```bash
clip < ~/.ssh/id_ed25519
```
</p>
</details>
See the detail information about [SSH login without password](http://www.linuxproblem.org/art_9.html)
See the detail information about [SSH login without password](http://www.linuxproblem.org/art_9.html)
### Example
### Example
Executing remote ssh commands using password.
#### Executing remote ssh commands using password
```yaml
```yaml
- name: executing remote ssh commands using password
- name: executing remote ssh commands using password
@ -118,7 +172,7 @@ Executing remote ssh commands using password.
script: whoami
script: whoami
```
```
Using private key
#### Using private key
```yaml
```yaml
- name: executing remote ssh commands using ssh key
- name: executing remote ssh commands using ssh key
@ -131,7 +185,7 @@ Using private key
script: whoami
script: whoami
```
```
Multiple Commands
#### Multiple Commands
```yaml
```yaml
- name: multiple command
- name: multiple command
@ -148,7 +202,7 @@ Multiple Commands
![result](./images/output-result.png)
![result](./images/output-result.png)
Multiple Hosts
#### Multiple Hosts
```diff
```diff
- name: multiple host
- name: multiple host
@ -164,7 +218,7 @@ Multiple Hosts
ls -al
ls -al
```
```
Multiple hosts with different port
#### Multiple hosts with different port
```diff
```diff
- name: multiple host
- name: multiple host
@ -179,7 +233,7 @@ Multiple hosts with different port
ls -al
ls -al
```
```
Synchronous execution on multiple hosts
#### Synchronous execution on multiple hosts
```diff
```diff
- name: multiple host
- name: multiple host
@ -195,7 +249,7 @@ Synchronous execution on multiple hosts
ls -al
ls -al
```
```
Pass environment variable to shell script
#### Pass environment variable to shell script
```diff
```diff
- name: pass environment
- name: pass environment
@ -218,7 +272,9 @@ Pass environment variable to shell script
_Inside `env` object, you need to pass every environment variable as a string, passing `Integer` data type or any other may output unexpected results._
_Inside `env` object, you need to pass every environment variable as a string, passing `Integer` data type or any other may output unexpected results._
Stop script after first failure. ex: missing `abc` folder
#### Stop script after first failure
> ex: missing `abc` folder
```diff
```diff
- name: stop script if command error
- name: stop script if command error
@ -247,7 +303,7 @@ err: mkdir: cannot create directory ‘abc/def’: No such file or directory
##[error]Docker run failed with exit code 1
##[error]Docker run failed with exit code 1
```
```
How to connect remote server using `ProxyCommand`?
#### How to connect remote server using `ProxyCommand`?
```bash
```bash
+--------+ +----------+ +-----------+
+--------+ +----------+ +-----------+
@ -271,7 +327,7 @@ Host FooServer
ProxyCommand ssh -q -W %h:%p Jumphost
ProxyCommand ssh -q -W %h:%p Jumphost
```
```
How to convert to YAML format of GitHubActions.
#### How to convert to YAML format of GitHubActions
```diff
```diff
- name: ssh proxy command
- name: ssh proxy command
@ -290,7 +346,11 @@ How to convert to YAML format of GitHubActions.
ls -al
ls -al
```
```
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.
#### 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
```diff
- name: ssh key passphrase
- name: ssh key passphrase
@ -305,3 +365,9 @@ Protecting a Private Key. The purpose of the passphrase is usually to encrypt th
whoami
whoami
ls -al
ls -al
```
```
## Contributing
We would love for you to contribute to `appleboy/ssh-action`, pull requests are welcome!
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)