Giter VIP home page Giter VIP logo

ssh-action1's Introduction

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.

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

Password and Private Key can only be configured one item

If you need to add some extra SSH parameters, you can setting the args option.

For example, add -tt parameter to solve: fifsky#4

Pseudo-terminal will not be allocated because stdin is not a terminal.

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

ssh-action1's People

Contributors

fifsky avatar the-go avatar jbh avatar imgbotapp avatar johannfenech avatar almostengr avatar hastalavistababy avatar okandas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.