This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine($"SSH Tunnel Start"); | |
PrivateKeyFile[] key1 = new PrivateKeyFile[] { new PrivateKeyFile("C:\\Users\\Administrator\\.ssh\\fifasports2.pem") }; | |
List<AuthenticationMethod> method1 = new List<AuthenticationMethod>(); | |
method1.Add(new PrivateKeyAuthenticationMethod("centos", key1)); | |
using (var ssh = new SshClient(new ConnectionInfo("1.1.1.1", "centos", method1.ToArray()))) | |
{ | |
ssh.Connect(); |