Here is a VB.NET example:
Imports Rebex.Net
Module Module1
Sub Main()
'connect to SSH server A'
Dim session As New SshSession()
session.Connect("serverA", 22)
session.Authenticate("userA", "passwordA")
'connect to SSH server B through SSH server A'
Dim client As New Ssh()
client.SetSocketFactory(session.ToSocketFactory()) 'set up tunneling through SSH'
client.Connect("serverB", 2222)
client.Login("userB", "passwordB")
'use the client here...'
End Sub
End Module
For compiling it, you have to reference following libraries:
- Rebex.Common.dll
- Rebex.Networking.dll
- Rebex.SshShell.dll
- Rebex.Terminal.dll
All these libraries are part of the Rebex SSH Shell package.