Greetings to You!
I have a problem with remote command execution through Renci::SshNet namespace.
Here is the code:
Additional information: No suitable authentication method found to complete authentication (publickey,keyboard-interactive)
Please tell me what I do wrong? :-) Please help me with that!
Thanks in advance!
I have a problem with remote command execution through Renci::SshNet namespace.
Here is the code:
PasswordAuthenticationMethod^ pam = gcnew PasswordAuthenticationMethod("username", "password");
KeyboardInteractiveAuthenticationMethod^ kiam = gcnew KeyboardInteractiveAuthenticationMethod("username");
System::String^ myData = "";
ConnectionInfo^ ci = gcnew ConnectionInfo("hostname", 22, "username", pam);
/*
using (SshClient^ ssh = gcnew SshClient(ci))
{
ssh.Connect();
}
*/
SshClient^ ssh = gcnew SshClient(ci);
ssh->Connect();
//ssh->RunCommand^ cmd =
//auto^ command = ssh->RunCommand("uname -a");
myData = Convert::ToString(ssh->RunCommand("uname -a")->Result);
this->textBox1->Text = myData;
ssh->Disconnect();
And the error is: An unhandled exception of type 'Renci.SshNet.Common.SshAuthenticationException' occurred in Renci.SshNet.dllAdditional information: No suitable authentication method found to complete authentication (publickey,keyboard-interactive)
Please tell me what I do wrong? :-) Please help me with that!
Thanks in advance!