n0nick / shaft

An SSH tunnel assistant for the command line.
http://n0nick.github.com/shaft/
MIT License
6 stars 1 forks source link

Shaft - right on.

 $$$$$$\  $$\   $$\  $$$$$$\  $$$$$$$$\ $$$$$$$$\
$$  __$$\ $$ |  $$ |$$  __$$\ $$  _____|\__$$  __|
$$ /  \__|$$ |  $$ |$$ /  $$ |$$ |         $$ |
\$$$$$$\  $$$$$$$$ |$$$$$$$$ |$$$$$\       $$ |
 \____$$\ $$  __$$ |$$  __$$ |$$  __|      $$ |
$$\   $$ |$$ |  $$ |$$ |  $$ |$$ |         $$ |
\$$$$$$  |$$ |  $$ |$$ |  $$ |$$ |         $$ |
 \______/ \__|  \__|\__|  \__|\__|         \__|

An SSH tunnel assistant for the command line.

Installation

As easy as:

$ gem install shaft

Usage

Your tunnel configurations need to be stored as records in a YAML formatted ~/.shaft file.

See 'Configuration' for instructions on how to format these files.

Configuration

The SSH tunnels configuration Shaft will use are all stored in a single YAML file under ~/.shaft.

Each tunnel is represented by a key defining its name, followed by an object describing all of the required parameters.

An example configuration would be:

foobar:
    port: 22
    username: user
    host: remote-host
    reverse: false
    bind:
      client-port: 9999
      host: host
      host-port: 8888

Calling Shaft with $ shaft start foobar would be equivalent to running:

  $ ssh -N -p 22 user@remote-host -L 9999:host:8888

ZSH Completions

Shaft includes a setup file for automatic completion of tunnel names if you use the ZSH shell.

To install it, you can run:

$ shaft completions >> ~/.zshrc

(Or output it to any file that your .zshrc includes). Don't forget to restart your shell!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request