Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
lock

GitHub Action

Remote SSH Commands

v0.0.3

Remote SSH Commands

lock

Remote SSH Commands

Run remote ssh commands

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Remote SSH Commands

uses: fifsky/ssh-action@v0.0.3

Learn more about this action in fifsky/ssh-action

Choose a version

Remote SSH Commands

Simple GitHub Action to run a command on a remote server using SSH. This is working with the latest GitHub Actions.

⭐️ SSH password are supported from version 0.0.3

✨ Example Usage

Example using OpenSSH private key

- name: ls -a via ssh
  uses: fifsky/ssh-action@master
  with:
    command: |
      cd /tmp
      ls -a
    host: ${{ secrets.HOST }}
    user: root
    key: ${{ secrets.PRIVATE_KEY}}

🔐 Set your secrets here: https://github.com/USERNAME/REPO/settings/secrets.

Check out the workflow example for a minimalistic yaml workflow in GitHub Actions.

Result

result of example ssh workflow

Options

  • host - string - Hostname or IP address of the server. Default: 'localhost'

  • port - integer - Port number of the server. Default: 22

  • user - string - Username for authentication. Default: (root)

  • key - string - Required, that contains a private key for either key-based or hostbased user authentication (OpenSSH format). Default: (none)

  • pass - string - Password for authentication.

Password and Private Key can only be configured one item

Tips

If emitting "mesg: ttyname failed: Inappropriate ioctl for device", You need to modify your Linux files as follows

vim /root/.profile
// Modify the "mesg n || true"  to "tty -s && mesg n || true"

Thanks

Documentation and parameters design from: https://github.com/garygrossgarten/github-action-ssh