Keyboard interactive authentication (wodSSH / wodSSH.NET)
Is there a sample available for keyboard interactive authentication? I am specifically looking for a scenario where the user would be able to connect to a SSH Server with the login and password entered by the user as a response to the server.
I tried something along the lines of this, but the LoginChallengeEvent does not get called and instead, the disconnect event is fired:
client = new WeOnlyDo.Client.SSH();
client.LicenseKey = "<mykey>";
client.Hostname = "<an IP>";
client.Blocking = true;
client.Protocol = SSH.SupportedProtocols.SSHAuto;
client.DataReceivedEvent += SSH_DataReceivedEvent;
client.Authentication = SSH.Authentications.KeyboardInteractive;
client.Login = "labuser";
client.DebugFile = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\sshauthenticationtest.txt";
//client.Password = "Password1";
client.LoginChallengeEvent += Client_LoginChallengeEvent;
client.PromptReceivedEvent += Client_PromptReceivedEvent;
client.StateChangedEvent += Client_StateChangedEvent;
client.DisconnectedEvent += Client_DisconnectedEvent;client.FingerPrintType = SSH.SupportedMACs.MD5;
client.FingerPrintEvent += Client_FingerPrintEvent;
client.CryptoInformationEvent += Client_CryptoInformationEvent;
client.Port = 22;
client.TerminalType = "xterm";
//client.Authentication = SSH.Authentications.None;
client.Connect();
The connect event throws up an error, like this:
{"Authentication with the server failed."}
It works in other authentication modes if the username and passwords are set programatically.
Complete thread:
- Keyboard interactive authentication - S Krupashankar, 2016-04-11, 14:17
- Keyboard interactive authentication - Jasmine, 2016-04-11, 14:23
- Keyboard interactive authentication - S Krupashankar, 2016-04-12, 13:38
- Keyboard interactive authentication - Jasmine, 2016-04-12, 15:33
- Keyboard interactive authentication - S Krupashankar, 2016-04-12, 18:17
- Keyboard interactive authentication - Jasmine, 2016-04-12, 21:07
- Keyboard interactive authentication - S Krupashankar, 2016-04-13, 10:52
- Keyboard interactive authentication - Jasmine, 2016-04-12, 21:07
- Keyboard interactive authentication - S Krupashankar, 2016-04-12, 18:17
- Keyboard interactive authentication - Jasmine, 2016-04-12, 15:33
- Keyboard interactive authentication - S Krupashankar, 2016-04-12, 13:38
- Keyboard interactive authentication - Jasmine, 2016-04-11, 14:23