title: Python Paramiko Permission denied
body: <p>Trying to execute commands on remote host via Paramiko:</p>
  
  <pre><code>    client = paramiko.SSHClient()
      client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      client.connect(hostname=host,  port=int(port), username=username, password=password) 
      stdin, stdout, stderr = ssh_client.exec_command(cmd, timeout=60)
  </code></pre>
  
  <p>For "simple" commands like 'top', 'ls -la', 'uname', etc ... all works fine.
  But for password asking commands like 'scp', I got the error (via Paramiko stderr): </p>
  
  <blockquote>
    <p>Permission denied (publickey,keyboard-interactive). </p>
    
    <p>lost connection</p>
  </blockquote>
  
  <p>even when trying to use the Paramiko 'stdin' object for input parameters:</p>
  
  <pre><code>stdin.write("myrootpasswd\n")
  stdin.flush()
  </code></pre>