title: How to ssh.invoke_shell() work under Linux
body: <pre><code>import paramiko
  import os
  import sys
  
  #Data conection
  ssh_servidor = 'xxx.xx.xx.xxx'
  ssh_usuario = 'yyy'
  ssh_clave = 'pws'
  ssh_puerto = yy
  
  # Conect to the server
  ssh = paramiko.SSHClient()
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  
  # Open a server session
  ssh.connect(ssh_servidor, ssh_puerto, ssh_usuario, ssh_clave)
  channel = ssh.invoke_shell()
  channel.send('clear')
  channel.send('\n')
  channel_data = str()
  
  while True:
  
      if channel.recv_ready():
          enter code herechannel_data += channel.recv(9999)
          print '############ Device Ouput ##############'
          print channel_data
          print '########################################'
  
      else:
          continue
  
      if channel_data.endswith('xxxx@yyyyy~$'):
          channel.send('ls | grep mmmm')
          channel.send('\n')
  </code></pre>
  
  <p>The problem is that in theory the var channel_data must have and print 
  This:</p>
  
  <pre><code>############ Device Ouput ##############
  Linux tito 2.6.32-5-amd64 #1 SMP Fri May 10 08:43:19 UTC 2013 x86_64
  
  The programs included with the Debian GNU/Linux system are free software;
  the exact distribution terms for each program are described in the
  individual files in /usr/share/doc/*/copyright.
  
  Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
  permitted by applicable law.
  Last login: Thu Dec 14 10:01:15 2017 from .xx.xx.xxx
  
  xxxx@yyyyy~$ 
  ########################################
  </code></pre>
  
  <p>Inted of that, it print this:</p>
  
  <pre><code>############ Device Ouput ##############
  Linux tito 2.6.32-5-amd64 #1 SMP Fri May 10 08:43:19 UTC 2013 x86_64
  
  The programs included with the Debian GNU/Linux system are free software;
  the exact distribution terms for each program are described in the
  individual files in /usr/share/doc/*/copyright.
  
  Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
  permitted by applicable law.
  Last login: Thu Dec 14 10:01:15 2017 from .xx.xx.xxx
  
  ########################################
  </code></pre>
  
  <p>The host "xxxx@yyyyy~$" it never appeared, so the part of the code when I asked for:</p>
  
  <pre><code>if channel_data.endswith('xxxx@yyyyy~$'):
  </code></pre>
  
  <p>It never happened.</p>
  
  <p>The only difference from this, to the paramiko librarie example I saw, was that the code work on Windows.</p>
  
  <p>So the quiestión is, what's the difference between win and Linux at this point?</p>
  
  <p>Why the S.O. do not show the host <code>xxxx@yyyyy~$</code> ?</p>
  
  <p>Any sugggestión?</p>