This project is read-only.

SSh termina for network switch

Mar 5, 2012 at 11:33 AM

I must to development a ssh teminal for download information from my network switch
I write:

 using (SshClient ssh = new SshClient("10.0.0.2", "System", "sistemami"))
            {
                ssh.Connect();
                PipeStream input = new PipeStream();
                StreamWriter inputSW = new StreamWriter(input);
                var sr = new StreamWriter(input);
                var output = Console.OpenStandardOutput();
                var shell = ssh.CreateShell(input, output, output, "xterm", 80, 24, 800, 600, "");
                shell.Stopped += delegate
                {
                    Console.WriteLine("\nDisconnected...");
                };
                shell.Start();
                sr.WriteLine("en");
                sr.Flush();
                sr.WriteLine("sistemami");
                sr.Flush();
                ssh.Disconnect();
            }
 but i have in console:
Sw01r05a01s01>en
Password: The thread '<No Name>' (0xeb0) has exited with code 0 (0x0). 

Can i solve it ?
Thanks 

Mar 5, 2012 at 11:27 PM

Hi,

 

I suggest you take a look at this thread: http://sshnet.codeplex.com/discussions/301739

and use ShellStream class instead of Shell.

 

I am planing to retire Shell class in the future since it was test case for me in the begining.

 

Hope it helps,

Thanks,

Oleg