所以我试图在已转发的会话中转发端口。这是代码:
require 'net/ssh'
Net::SSH.start(
'1.2.3.4', 'username',
:host_key => "ssh-rsa",
:keys => [ "/Users/awesomesauce/.ssh/coolness.pem" ],
) do |session|
session.forward.remote(8080, "localhost", 8081)
# Heres where I want to forward over the 'session'
# session.forward.remote(8081, "some.other.host", 80)
session.loop { true }
end
有什么想法吗?