Skip to content
Net::SSH::Proxy compatible SSH-tunneling built on Net::SSH::Gateway
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/net/ssh/proxy
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE
README.md
net-ssh-proxy-gateway.gemspec

README.md

Build Status Gem Version Yard Docs

Net::SSH::Proxy::Gateway

Allows using Net::SSH::Gateway as a proxy in Net::SSH.start(host, user, proxy:..).

Installation

Add this line to your application's Gemfile:

gem 'net-ssh-proxy-gateway'

And then execute:

$ bundle

Or install it yourself as:

$ gem install net-ssh-proxy-gateway

Usage

It accepts the same parameters as Net::SSH::Gateway.new which works quite a lot like Net::SSH.start.

Example

session = Net::SSH.start(
  'target-host-name-or-ip.example.com',
  'target-host-username',
  proxy: Net::SSH::Proxy::Gateway.new(
    'proxy-host-hostname-or-ip.example.com',
    'proxy-host-username',
    #proxy_host_connection_options (see Net::SSH.start)
  )
)

Tada! The session to the target host will be tunneled through the proxy host. Nothing else for you to do. The port forwarding will be automatically canceled when the main session is closed.

Contributing

Bug reports and pull requests are welcome on GitHub at kontena/net-ssh-proxy-gateway.

You can’t perform that action at this time.