KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to connect to an AIX box and execute some commands using SSH.NET library. The following is the code snipplet KeyboardInteractiveAuthenticationMethod kauth = new KeyboardInteractiveAuthenticationMethod(username); PasswordAuthenticationMethod pauth = new PasswordAuthenticationMethod(username, password); ConnectionInfo connectionInfo = new(ConnectionInfo(servername, 22, username, pauth,kauth); SshClient sshClient = new SshClient(connectionInfo); sshClient.Connect(); SshCommand sshCommand = sshClient.RunCommand("mpstat"); Console.WriteLine(sshCommand.Result); Console.ReadKey(); I get the following exception message when I try to connect at the line sshClient.Connect() {"Value cannot be null.\r\nParameter name: data"} The stack trace is at Renci.SshNet.KeyboardInteractiveAuthenticationMethod.Authenticate(Session session) at Renci.SshNet.ConnectionInfo.Authenticate(Session session) at Renci.SshNet.Session.Connect() at Renci.SshNet.BaseClient.Connect() I am confident that the credentials I pass are valid since I am able to log-in using the PuTTY client with the same credentials. Any ideas?
Tags (comma-separated)
Save Edits
Cancel