Kayen
Kayen

Reputation: 25

Network tunneling using Ruby

How can I do ssh [email protected] -L 3000:171.17.258.16:1500 on a Windows machine using Ruby?

On my Windows machine I am using the rye gem to do a simple connection like:

@rbox = Rye::Box.new(@hostname, :user => @username, :password => @password)

Upvotes: 0

Views: 109

Answers (1)

Raj
Raj

Reputation: 1784

Maybe try checking out the Net-SSH gem?

http://rubygems.org/gems/net-ssh/

http://net-ssh.github.com/net-ssh/

Seems like the forward method does what you want to do:

Net::SSH.start("host", "user", :password => "password") do |ssh|
  ssh.forward.local(1234, "www.google.com", 80)
  ssh.loop { true }
end

Upvotes: 1

Related Questions