All hello!
It is urgently necessary to solve a problem:
I try to adjust ssh connection to a distant host. I use library Renci. SshNet. Connection to a host transits, some commands even work. Using the following code at command performance ssh host the program hangs up:
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo (hostname, port, username, password);
connectionInfo. Timeout = TimeSpan. FromSeconds (30);
using (var client = new SshClient (connectionInfo))
{
try
{
client. Connect ();
if (client. IsConnected)
{
var cmd = client. CreateCommand ("ssh node44");
string response = cmd. Execute ();
}
}
}
And to this code of hangup does not happen, but also to a node not :
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo (hostname, port, username, password);
connectionInfo. Timeout = TimeSpan. FromSeconds (30);
using (var client = new SshClient (connectionInfo))
{
try
{
client. Connect ();
if (client. IsConnected)
{
IDictionary<Renci.SshNet.Common.TerminalModes, uint> termkvp = new Dictionary<Renci.SshNet.Common.TerminalModes, uint> ();
termkvp. Add (Renci. SshNet. Common. TerminalModes. ECHO, 53);
ShellStream shellStream = client. CreateShellStream ("xterm", 80, 24, 800, 600, 1024, termkvp);
shellStream. WriteLine ("ssh node44");
}
}
}
Help please!