title: SSH Password through Python Subprocess
body: <p>I am writing a GUI program to spawn and monitor SSH tunnels for a group of users who are too intimidated to use a command-line.</p>
  
  <p>Unfortunately, the servers in question are very strict. Two-factor authentication via RSA SecurID token is the only officially-endorsed way to open an SSH connection. Passwordless RSA public/private key authentication is not allowed.</p>
  
  <p>Therefore, it is necessary for my program to read a password from a text entry box and send it to the child SSH process. Unfortunately, <code>ssh</code> goes to great lengths to ensure passwords come only from a real keyboard.</p>
  
  <p>I strongly prefer not to use third-party modules. I am aware of paramiko and pexpect (which are both put forward as possible solutions to similar problems), but trying to explain to my users how to install Python modules from source is too much of a headache.</p>
  
  <p>So: How can you send a password to an ssh subprocess using <em>only</em> the standard python <code>subprocess</code> module? Is there any way to fool the subprocess into thinking I'm using a TTY? Is it possible to use SSH_ASKPASS to read from my program?</p>
  
  <p>Other standard-library modules (e.g., low-level commands with the <code>os</code> module) are also allowed.</p>