Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Visual C++ authentication error.

$
0
0
Greetings to You!

I have a problem with remote command execution through Renci::SshNet namespace.

Here is the code:
PasswordAuthenticationMethod^ pam = gcnew PasswordAuthenticationMethod("username", "password");
            KeyboardInteractiveAuthenticationMethod^ kiam = gcnew KeyboardInteractiveAuthenticationMethod("username");
            
            System::String^ myData = "";

            ConnectionInfo^ ci = gcnew ConnectionInfo("hostname", 22, "username", pam);

            /*
            using (SshClient^ ssh = gcnew SshClient(ci))
            {
                ssh.Connect();
            }
            */

            SshClient^ ssh = gcnew SshClient(ci);
            ssh->Connect();
            //ssh->RunCommand^ cmd = 
            //auto^ command = ssh->RunCommand("uname -a");
            myData = Convert::ToString(ssh->RunCommand("uname -a")->Result);
            
            this->textBox1->Text = myData;

            ssh->Disconnect();
And the error is: An unhandled exception of type 'Renci.SshNet.Common.SshAuthenticationException' occurred in Renci.SshNet.dll

Additional information: No suitable authentication method found to complete authentication (publickey,keyboard-interactive)


Please tell me what I do wrong? :-) Please help me with that!

Thanks in advance!

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>