Skip to content

Configurable ssh client. Run pre-configured commands on remote machines.

Notifications You must be signed in to change notification settings

pcrandall/gosshclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH client

Connect to remote server and run pre-configured commands setup in ./config/config.yml

If config file is present, SSH client will use the config file present and ignore embedded config.

If no config file is present the binary will look for embedded config.

Usage

1. Configure ./config/config.yml for your remote hosts

2. Installs go-bindata if not already installed
  make install

3. Run
  make run

4. Build
  make build

Config file format

host:
- name: NAME
  connection: IP:PORT # IP address and port SSH server running on remote host
  username: USERNAME # user to login as on remote host
  password: PASSWORD
  commands:
    - name: Name of command  # User-friendly alias
      string: command string # Command to run on remote host
      userinput: true # set to true for prompt to append user input to the command string
      whitespace: false # Used to insert white before the end of command string

    - name: List files
      string: ls -alh
      userinput: false
      whitespace: false

    - name: Search Logs
      string: cd /var/log; find . -name * -print0 | xargs -0 grep
      userinput: true
      whitespace: true
  • Only password and keyboard-interactive authentication supported at this time. keyboard-interactive will automatically fill the password field provided in /config/config.yml when prompted.

How to embed config in binary

Either run ./build.sh or manually embed config.

Install go-bindata

go get -u github.com/go-bindata/go-bindata/...

Embed config folder into binary

go-bindata -o config.go config

About

Configurable ssh client. Run pre-configured commands on remote machines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published