title: Pexpect does not synchronized with firewall prompt
body: <p>I am trying to get data from a firewall using Pexpect module (More specifically, pxssh). The login process is okey and the problem comes exactly in the "i" assignment line:</p>
  
  <pre><code>if i==2: # password or passphrase
              self.sendline(password)
              # Up to here, everything is okay#
              i = self.expect(["(?i)are you sure you want to continue connecting", original_prompt, "(?i)(?:password)|(?:passphrase for key)", "(?i)permission denied", "(?i)terminal type", TIMEOUT])
  </code></pre>
  
  <p>This is the firewall's dialog when an user is logged in :</p>
  
  <blockquote>
    <p>Password:  </p>
    
    <p>Last login: Mon Sep 25 06:20:50 2017 from IPXXXX</p>
    
    <p>Number of failed attempts since last successful login: 0</p>
    
    <p>admin@DEVICE(active)></p>
  </blockquote>
  
  <p>I think the problem is that Pexpect don't expect these two lines of Last Login and Number of failed attempts, so the code execution is stopped in the line I said before.</p>
  
  <p>Could someone help me? </p>
  
  <p>----UPDATE----</p>
  
  <p>Shell that the firewall uses: </p>
  
  <pre><code>admin@DEVICE(active)&gt;
  </code></pre>
  
  <p>Init code of my pexpect class:</p>
  
  <pre><code>def __init__(self, host, user, password):
      str = 'ssh '+user+'@'+host
      self.user = user
      self.child = pexpect.spawn ('ssh '+user+'@'+host)
      self.child.expect ('Password:.*')
      self.child.sendline (password)
      self.child.expect (user+'.*&gt;')
      ...
  </code></pre>
  
  <p>)</p>
  
  <p>Thanks beforehand,</p>
  
  <p>Mike.</p>