title: Multi-factor authentication (password and key) with Paramiko
body: <p>I've got the following code:</p>
  
  <pre><code>import paramiko
  policy = paramiko.client.WarningPolicy()
  client = paramiko.client.SSHClient()
  client.set_missing_host_key_policy(policy)
  username = '...'
  password = '...'
  file_path = '...'
  pkey = paramiko.RSAKey.from_private_key_file(file_path)
  client.connect('...', username=username, password=password, pkey=key)
  sftp = client.open_sftp() 
  </code></pre>
  
  <p>From the docs, it seems like it should work. Everything works successfully, but when the code hits <code>client.open_sftp</code> it bombs with a <code>SSHException: Unable to open channel.</code> and the transport (from <code>client.get_transport</code>) is active but not authenticated. I'm also having trouble enabling debug logging for this (I'm trying <code>logging.getLogger('paramiko').setLevel(logging.DEBUG)</code> without success.)</p>
  
  <p>Any ideas on where I can start to debug this very vague error message?</p>