On 15.05.2009, at 21:09, Ad Ad wrote:

> Hi,
> I have a remote server B which can only accessed via server A  
> through a
> public key.
>
> Is there a way to do this in net/ssh ?

Yes it's very simple.
http://net-ssh.rubyforge.org/ssh/v2/api/index.html

> I have started an SSH session for A
>
>  Net::SSH.start("ServerA","username",:password=>"xyz") do |ssh|
Net::SSH.start("ServerA","username",:keys=>["~/.ssh/id_rsa"]) do |ssh|
>
>     #is there a way to now login into B?
>     #In putty I just do: ssh B and I am in
>  end



regards, Sandor Szs
--