Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: telnet

$
0
0
I was able to get this to work using ShellStream. Here is what I used:
 using (var ssh = new Renci.SshNet.SshClient(connectionInfo))
        {
            ssh.Connect();
            Renci.SshNet.ShellStream stream = ssh.CreateShellStream("xterm", 80, 50, 1024, 1024, 1024);
            StreamReader Reader = new StreamReader(stream);
            StreamWriter Writer = new StreamWriter(stream);
            Writer.AutoFlush = true;
            Thread.Sleep(500);
            string Result = Reader.ReadToEnd();
            Writer.WriteLine("telnet host -l user");
            Thread.Sleep(500);
            Result = Reader.ReadToEnd();
            Writer.WriteLine("password");
            Thread.Sleep(500);
            Result = Reader.ReadToEnd();                
        }

Please let me know if there is a more efficient way.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>