$$$$$$\ $$\ $$\ $$$$$$\ $$$$$$$$\ $$$$$$$$\ $$ __$$\ $$ | $$ |$$ __$$\ $$ _____|\__$$ __| $$ / \__|$$ | $$ |$$ / $$ |$$ | $$ | \$$$$$$\ $$$$$$$$ |$$$$$$$$ |$$$$$\ $$ | \____$$\ $$ __$$ |$$ __$$ |$$ __| $$ | $$\ $$ |$$ | $$ |$$ | $$ |$$ | $$ | \$$$$$$ |$$ | $$ |$$ | $$ |$$ | $$ | \______/ \__| \__|\__| \__|\__| \__|
An SSH tunnel assistant for the command line.
As easy as:
$ gem install shaft
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.
- Use
shaft all
to get a list of all available tunnels. - Use
shaft active
to see which tunnels are currently active.- You could use the
--short
option to get only the names of those lines (this could be useful to insert into your shell prompt. Just saying).
- You could use the
shaft start [NAME]
would start the tunnel of the same name.shaft stop [NAME]
would stop the tunnel of the given name.
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
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!
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request