Skip to content

GitHub Action for setting up everything needed for connecting to a remote SSH server from the runner.

License

Notifications You must be signed in to change notification settings

tichopad/setup-ssh-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

setup-ssh-client

GitHub Action for setting up everything needed for connecting to a remote SSH server from the runner.

Warning

This action overwrites any existing SSH keys already saved in the ~/.ssh/id_rsa file.

Usage

jobs:

  do-the-thing:

    runs-on: ubuntu-latest

    steps:

      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup SSH client
        uses: tichopad/setup-ssh-client@v1
        with:
          ssh-key: ${{ secrets.SSH_KEY }}

      - name: Connect to SSH server
        run:  ssh -T -o StrictHostKeyChecking=no [email protected] 'echo "Hello, world!"'

If you want to avoid using the StrictHostKeyChecking=no option for better security, you can add the host key to the known hosts file by using the known-hosts input:

jobs:

  do-the-thing:

    runs-on: ubuntu-latest

    steps:

      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup SSH client
        uses: tichopad/setup-ssh-client@v1
        with:
          ssh-key: ${{ secrets.SSH_KEY }}
          known-hosts: ${{ secrets.KNOWN_HOSTS }}

      - name: Connect to SSH server
        run:  ssh -T [email protected] 'echo "Hello, world!"'

About

GitHub Action for setting up everything needed for connecting to a remote SSH server from the runner.

Resources

License

Stars

Watchers

Forks

Packages

No packages published