In addition to using the SshClient to create the session, I have modified Session.cs as follows,
Session.cs
Which meant the test program could look like this,
TestProgram.cs
Session.cs
public Session(ConnectionInfo connectionInfo) { this.ConnectionInfo = connectionInfo; //this.ClientVersion = string.Format(CultureInfo.CurrentCulture, "SSH-2.0-Renci.SshNet.SshClient.{0}", this.GetType().Assembly.GetName().Version);this.ClientVersion = string.Format(CultureInfo.CurrentCulture, "SSH-2.0-Renci.SshNet.SshClient.0.0.1"); }
TestProgram.cs
using(var session = new Session(new PasswordConnectionInfo(host, username, password))) { session.Connect(); var scpClient = new ScpClient(session); scpClient.Uploading += scpClient_Uploading; Console.WriteLine("SCP connect? " + scpClient.IsConnected); FileInfo fileInfo = new FileInfo(@"C:\mybin\temp.exe"); scpClient.Upload(fileInfo, "/home/temp/test/temp.exe"); scpClient = new ScpClient(session); scpClient.Uploading += scpClient_Uploading; Console.WriteLine("SCP connect? " + scpClient.IsConnected); fileInfo = new FileInfo(@"C:\mybin\temp.exe"); scpClient.Upload(fileInfo, "/home/temp/test/temp2.exe"); }