No commit activity in last 3 years
No release in over 3 years
Like using Net::SSH::Gateway but it can be passed to Net::SSH.start(proxy: ...)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0

Runtime

>= 2.0.0, ~> 2.0
 Project Readme

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.