Error when I login to a linux server

Mar 9, 2015 at 2:03 PM
I'm receive errors when I login to some linux machines, the error is: "Unable to connect to watcher: Exception calling "Connect" with "0" argument(s): "No suitable authentication method found to complete authentication (publickey,keyboard-interactive)."
Mar 9, 2015 at 2:45 PM
Hi, this should work for both AIX and Linux:
 _OutErr = "";

        var KeyboardInteractive = new KeyboardInteractiveAuthenticationMethod(_User);
        KeyboardInteractive.AuthenticationPrompt += delegate(Object senderObject, AuthenticationPromptEventArgs eventArgs)
        {
            foreach (var prompt in eventArgs.Prompts)
            {
                if (prompt.Request.Equals("Password: ", StringComparison.InvariantCultureIgnoreCase))
                {
                    prompt.Response = "password";
                }
            }
        };

        var passwordAuthMethod = new PasswordAuthenticationMethod(_User, _Pw));
        var connectionInfo = new ConnectionInfo(_Server, _User, passwordAuthMethod, KeyboardInteractive);
        SshClient sshe = new SshClient(connectionInfo);

        try
        {
            sshe.Connect();
            _Out = sshe.RunCommand(_Cmd);
        }
        catch (Exception eConnect)
        {
            _OutErr = eConnect.Message;
        }
        finally
        {
            sshe.Disconnect();
            sshe.Dispose();
        }

regards
jmueller
Mar 11, 2015 at 5:48 AM
thanks for the reply jmuelle. can i test the script and if i have questions can i message you back. thanks