I am trying to connect to a Solaris/Unix server using the C# class to read system information / configuration, use memory, etc.
My requirement is to run commands on the server from a C # application ( as happens with the PuTTY client ), and save the response in a string variable for further processing.
After some research, I found that in order to do the same, you can use the SharpSSH library.
When I try to run my code, the following line gives me an Auth Fail exception . I am sure that the credentials (server name, username and password) are correct, since I can log in from the PuTTY client with the same credentials.
SshStream ssh = new SshStream(servername, username, password);
What am I doing wrong?
Below is a stack trace if that helps!
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout) at Tamir.SharpSsh.jsch.Session.connect() at Tamir.SharpSsh.SshStream..ctor(String host, String username, String password)
source share