title: Python - ssh with password to foreign computer without using non-built-in modules
body: <p>Before you down vote this, let me say that I've read ALOT of questions on this subject on SO and haven't found the answer.  This one has the closest thing to what I need though on the answer by "Neil".</p>
  
  <p><a href="https://stackoverflow.com/questions/1233655/what-is-the-simplest-way-to-ssh-using-python">What is the simplest way to SSH using Python?</a></p>
  
  <p>I would like to find a way to log into another host using ssh, providing a password, without importing non-standard python modules.  I would then need to be able to send multiple commands using the ssh connection.  I need to do this because I need to automate something on a lot of closed systems that I cannot get new modules on to (non internet accessible).</p>
  
  <p>The answer in the referenced question is:</p>
  
  <blockquote>
    <p>If you want to avoid any extra modules, you can use the subprocess
    module to run</p>
    
    <p>ssh [host] [command] and capture the output.</p>
    
    <p>Try something like:</p>
    
    <p>process = subprocess.Popen("ssh example.com ls", shell=True,
        stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output,stderr = process.communicate() status = process.poll() print output To deal
    with usernames and passwords, you can use subprocess to interact with
    the ssh process, or you could install a public key on the server to
    avoid the password prompt.</p>
  </blockquote>
  
  <p>Which sounds good, but I can't quite understand this well enough to take it farther.  Can someone help me to get a baby step going?</p>
  
  <pre><code>(1) log in to ssh
  (2) provide the password when its prompted
  (3) issue an ls command and display the result
  </code></pre>
  
  <p>I can do the rest of the automation if I can just get pass password entry.</p>
  
  <p>PS: I tried using expect, but TCL isn't on the system so please don't tell me to use that!  If you know something else I can call to aid python I'm happy to try it though as long as its likely to be built into a Fedora Enterprise Linux system by default.</p>