https://github.com/kontena/net-ssh-proxy-gateway
Net::SSH::Proxy compatible SSH-tunneling built on Net::SSH::Gateway
https://github.com/kontena/net-ssh-proxy-gateway
net-ssh ruby ssh tunneling
Last synced: 5 months ago
JSON representation
Net::SSH::Proxy compatible SSH-tunneling built on Net::SSH::Gateway
- Host: GitHub
- URL: https://github.com/kontena/net-ssh-proxy-gateway
- Owner: kontena
- License: apache-2.0
- Created: 2019-03-14T10:24:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-14T12:33:18.000Z (over 7 years ago)
- Last Synced: 2025-12-15T16:19:36.311Z (7 months ago)
- Topics: net-ssh, ruby, ssh, tunneling
- Language: Ruby
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/kontena/net-ssh-proxy-gateway)
[](https://badge.fury.io/rb/net-ssh-proxy-gateway)
[](https://www.rubydoc.info/github/kontena/net-ssh-proxy-gateway)
# Net::SSH::Proxy::Gateway
Allows using [`Net::SSH::Gateway`](https://github.com/net-ssh/net-ssh-gateway) as a proxy in `Net::SSH.start(host, user, proxy:..)`.
## Installation
Add this line to your application's Gemfile:
```ruby
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`](https://www.rubydoc.info/github/net-ssh/net-ssh-gateway) which works quite a lot like [`Net::SSH.start`](https://www.rubydoc.info/github/net-ssh/net-ssh/Net%2FSSH.start).
### Example
```ruby
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](https://github.com/kontena/net-ssh-proxy-gateway).