Copy Private Key content and paste in Github Secrets.
<details>
<summary>rsa</summary>
<p>
```bash
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)
### Example
Executing remote ssh commands using password.
#### Executing remote ssh commands using password
```yaml
- name: executing remote ssh commands using password
@ -118,7 +172,7 @@ Executing remote ssh commands using password.
script: whoami
```
Using private key
#### Using private key
```yaml
- name: executing remote ssh commands using ssh key
@ -131,7 +185,7 @@ Using private key
script: whoami
```
Multiple Commands
#### Multiple Commands
```yaml
- name: multiple command
@ -148,7 +202,7 @@ Multiple Commands
![result](./images/output-result.png)
Multiple Hosts
#### Multiple Hosts
```diff
- name: multiple host
@ -164,7 +218,7 @@ Multiple Hosts
ls -al
```
Multiple hosts with different port
#### Multiple hosts with different port
```diff
- name: multiple host
@ -179,7 +233,7 @@ Multiple hosts with different port
ls -al
```
Synchronous execution on multiple hosts
#### Synchronous execution on multiple hosts
```diff
- name: multiple host
@ -195,7 +249,7 @@ Synchronous execution on multiple hosts
ls -al
```
Pass environment variable to shell script
#### Pass environment variable to shell script
```diff
- 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._
Stop script after first failure. ex: missing `abc` folder
#### Stop script after first failure
> ex: missing `abc` folder
```diff
- 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
```
How to connect remote server using `ProxyCommand`?
#### How to connect remote server using `ProxyCommand`?
```bash
+--------+ +----------+ +-----------+
@ -271,7 +327,7 @@ Host FooServer
ProxyCommand ssh -q -W %h:%p Jumphost
```
How to convert to YAML format of GitHubActions.
#### How to convert to YAML format of GitHubActions
```diff
- name: ssh proxy command
@ -290,7 +346,11 @@ How to convert to YAML format of GitHubActions.
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
- name: ssh key passphrase
@ -305,3 +365,9 @@ Protecting a Private Key. The purpose of the passphrase is usually to encrypt th
whoami
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)