Skip to content
lock

GitHub Action

SSH remote command executer

v1 Pre-release

SSH remote command executer

lock

SSH remote command executer

To run ssh remote commands

Installation

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

              

- name: SSH remote command executer

uses: tarunjangra/ssh-remote-cmd@v1

Learn more about this action in tarunjangra/ssh-remote-cmd

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.

✨ Example Usage

Example using OpenSSH private key

- name: ls -a via ssh
  uses: tarunjangra/ssh-remote-cmd@v1
  with:
    command: |
      cd /tmp
      ls -a
    host: ${{ secrets.HOST }}
    user: root
    key: ${{ secrets.PRIVATE_KEY}}

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.

  • args - string - SSH parameters for example: -tt.

Password and Private Key can only be configured one item