title: issue in doing a telnet connection through ssh on to a linux device box?
body: <p>We are facing trouble establishing telnet connection via ssh.  firstly I used rencissh library to establish ssh on to the linux box.</p>
  
  <pre><code>linux_box_ip/host/password : 192.168.4.127/admin/password12 
  </code></pre>
  
  <p>Then, i try to do a telnet connection by calling tcp class,</p>
  
  <pre><code>tcpSocket = new TcpClient(host,port); 
  host/port:  192.168.4.127/18080 
  </code></pre>
  
  <p>but the connection is refused by the device.
  After some stackflow post read, i understand we need to follow a sequence where you do a Ssh and then do a port forwarding and then do a telnet.
  so i tried the below  code.</p>
  
  <pre><code>connectionInfo connNfo = new connectionInfo("192.168.4.127",22,"admin",
       new AuthenticationMethod[]{
             new PasswordAuthenticationMethod("Admin","password12")
         });
  using(var sshclient = new SshClient(connNfo )){
       sshclient .Connect();
  var port = new ForwardedPortLocal("localhost",22,"192.168.4.128",18080 );
  sshClient.AddForwardedPort(port);
  
  
      port.Exception += delegate(object sender, ExceptionEventArgs e)
      {
          Console.WriteLine(e.Exception.ToString());
      };
      port.Start();
  </code></pre>
  
  <p>So, once this is done i do a tel net on the host/port: 192.168.4.127/18080 </p>
  
  <pre><code>tcpSocket = new TcpClient(host,port); 
  host/port:  192.168.4.127/18080 
  </code></pre>
  
  <p>Again it seems to fail with the messsage:</p>
  
  <blockquote>
    <p>NO connection could be made, target machine refused it</p>
  </blockquote>
  
  <p>How do i do seamless ssh and then telnet on the device box ?? am i doing something wrong ?</p>