title: SSH keygen error: 'passphrase too short: have 2 bytes, need >4'
body: <p>I am trying to automate the process of generating an SSH RSA key.When the command below is run on the command line it generates the key correctly:</p>
  
  <pre><code>ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
  </code></pre>
  
  <p>The issue arises when I try to replicate this in a python 2 script.</p>
  
  <pre><code> if not os.path.isfile('/root/.ssh/id_rsa.pub'):
      fullcmd = ['ssh-keygen', '-f', '/root/.ssh/id_rsa', '-t', 'rsa', '-N', '\'\'']
      sshcmd = subprocess.Popen(fullcmd,
                  shell= False,
                  stdout= subprocess.PIPE,
                  stderr= subprocess.STDOUT)
      out = sshcmd.communicate()[0].split('\n')
      for lin in out:
          print lin
  </code></pre>
  
  <p>When I run this script I get this error:</p>
  
  <pre><code>&gt; passphrase too short: have 2 bytes, need &gt;4
  &gt; Generating public/private
  &gt; rsa key pair. Saving the key failed: /root/.ssh/id_rsa.
  </code></pre>
  
  <p>Why dose it work when I execute it on the command line and not through the python script?</p>