mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 01:05:42 +00:00
1
How to obtain remote server info
Gert Driesen edited this page 2017-02-15 20:56:01 +01:00
When submitting an issue, the name and version of the SSH server software is always useful - and in some cases even crucial - information.
If the issue you're reporting does not prevent you from establishing a connection, then you can use the following code - with the correct host and credentials - to write the identification string of the SSH server software to the console:
using (var client = new SshClient("127.0.0.1", "user", "pwd"))
{
client.Connect();
Console.WriteLine(client.ConnectionInfo.ServerVersion);
}
This identification string usually contains both the name and version of the server software.