3

I would like to transform this unix command into a ruby script

ssh -2 -f -c blowfish -N -C user@ip -D 8080

This is to enable all my web traffic to be encrypted in a ssh tunnel.

I tried with net-ssh library without success.

EDIT:

Here is what I tried :

 Net::SSH.start("my-ssh-server", "login") do|ssh|
   ssh.forward.local(8080, "localhost", 80)
   puts "Connected !"
   ssh.loop(0) { true }
 end

Here is the documentation of Net:SSH http://net-ssh.rubyforge.org/ssh/v1/chapter-6.html#s4 I think, I should use Direct Channels instead of Local-to-Remote. But the method session.forward.direct_channel is not implemented.

Thanks for your answers !

Arkan
  • 6,196
  • 3
  • 38
  • 54

1 Answers1

-2

Stupid and simple:

fork("ssh -2 -f -c blowfish -N -C user@ip -D 8080")

Why not that way?

Reactormonk
  • 21,472
  • 14
  • 74
  • 123