Quantcast
Channel: Programmer's Town -
Viewing all articles
Browse latest Browse all 2

//programmer3637.rssing.com/chan-67978117/article1-live.html

$
0
0

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!


Viewing all articles
Browse latest Browse all 2

Trending Articles


UPDATE SC IDOL: TWO BECOME ONE


Arbol genealogico para colorear


Sapos para colorear


Long Distance Relationship Tagalog Love Quotes


Knock knock jokes


RE: Mutton Pies (frankie241)


Hagibis (1946) by Francisco V. Coching


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo Create - Video Maker & Editor 1.3.3 by Vimeo Inc


Vimeo 3.41.0 by Vimeo Inc