I keep getting the following error when I try to connect to an SSH server (in this case the SSH server is the iDRAC on a Dell server):
Renci.SshNet.Common.SshAuthenticationException
HResult=0x80131500
Message=No suitable authentication method found to complete authentication (publickey,keyboard-interactive).
Everything I have found references SCP, but I am not using SCP as I am not downloading a file. I need to run a command on the iDRAC to get the system event log and display it in a textbox. The code below is called by a button event handler (further down):
public string ConnectSSH(string RemoteHost, string UserName, string PassWord, string sshCommand, out string ServerResponse)
{
using (var client = new SshClient(RemoteHost, 22, UserName, PassWord))
{
client.Connect();
var cmd = client.CreateCommand(sshCommand);
var asyncResult = cmd.BeginExecute();
var outputReader = new StreamReader(cmd.OutputStream);
string output;
while (!asyncResult.IsCompleted)
{
output = outputReader.ReadToEnd();
ServerResponse = output;
}
output = outputReader.ReadToEnd();
ServerResponse = output;
client.Disconnect();
return ServerResponse;
}
}
And the button event handler code:
private void BtnGetSel_Click(object sender, EventArgs e)
{
RemoteHost = TxtHostName.Text;
UserName = TxtUserName.Text;
PassWord = TxtPassWord.Text;
SshCommand = "racadm getsel -E";
ConnectSSH(RemoteHost, UserName, PassWord, SshCommand, out ServerResponse);
LblServerResponse.Text = ServerResponse;
}