I am trying to connect to a Avocent ACS6000 with SSH using c# WinForms. The follow code is successful when trying to connect to a Windows SSH Server.
But it does not work on the desired device throws exception
exception : No suitable authentication method found to complete authentication (publickey,keyboard-interactive)
I've found the following solutions but either not match for my problem or I don't know how to use them.
- Changing Key exchange method in SSH.NET ( don't know how to pick and use a key )
- SSH.NET Public Key Authentication or SSH.NET Authenticate via private key only (public key authentication) (can't make it work)
IS IT POSSIBLE to force windows to include the hmac-sha2-512
argument by default. So when I try to connect it will always use this algorithm ? Using Putty it prompts me to accept the key and it works perfect.
(code using using Renci.SshNet)
sshclient = new SshClient(IPadress, port, username, password);
try
{
OutputRichTextBox.AppendText("SSH Conecting..." + Environment.NewLine);
sshclient.Connect();
if (sshclient.IsConnected == true)
{
OutputRichTextBox.AppendText("Connected to Server" + Environment.NewLine);
}
else
{
OutputRichTextBox.AppendText("Ping failed." + Environment.NewLine);
}
}
catch
{
OutputRichTextBox.AppendText("Error : Not Connected" + Environment.NewLine);
}
I first tested it to the Windows Server CommandPrompt using the ssh root@x.x.x.x
and it connects successfully. But to the Avocent device it requires to ssh root@x.x.x.x -m hmac-sha2-512
command
When trying to connect without the last argument with CMD:
C:\Users\User>ssh root@x.x.x.x
The authenticity of host 'x.x.x.x (x.x.x.x)' can't be established.
ED25519 key fingerprint is SHA256:(**key**).
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Corrupted MAC on input.
ssh_dispatch_run_fatal: Connection to 10.1.10.47 port 22: message authentication code incorrect