using System;
using Renci.SshNet;
namespace Foo
{
public class Bar
public static void Main(string[] args)
using (var client = new SshClient("hostMachineA", "usernameMachineA", "passwordMachineA"))
client.Connect();
var command = client.CreateCommand("ssh usernameMachineB@hostMachineB");
command.Execute();
// You are now connected to hostMachineB, any commands you execute on the client will get executed on the hostMachineB
}
Console.ReadLine();