0

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;
        }
3
  • You have to provide authentication method. See here Commented Dec 30, 2020 at 5:07
  • I'm not sure, but I think you should specify the authentication method: var methods = new List<AuthenticationMethod>(); methods.Add(new PasswordAuthenticationMethod(UserName, PassWord); var con = new ConnectionInfo(RemoteHost, Port, UserName, methods.ToArray()); using (var client = new SftpClient(con)) { client.Connect(); } Commented Dec 30, 2020 at 5:17
  • you can see the usage in the documentation for the library: github.com/sshnet/SSH.NET/#usage Commented Dec 30, 2020 at 5:26

1 Answer 1

-1

Due to limitations of the iDRAC CLI, I resorted to using plink.exe (part of PuTTY) to connect to it via SSH. I think the issue is that you can't modify the sshd_config files on the iDRAC (they lock it down so you can't access the underlying filesystem for security reasons). Plink allows me to do what I want, but PuTTY will need to be part of the installation process of the application.

Sign up to request clarification or add additional context in comments.

3 Comments

What does Plink allow you do to that SSH.NET does not?
It allows me to log in to the iDRAC without issues. The iDRAC is not much more than a mini version of linux, but it is pretty much impossible to access the underlying OS and change settings, such as the sshd_config file.
What "issues" do you have with SSH.NET? Did you see my comment above? Haven't it resolved your "issue"?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.