title: How do I SSH to EC2 instance with pem key using Python ( without paramiko module)
body: <p>How can I log in to EC2 Instance with pem key using python without using paramiko module, The below code with paramiko works but I need without paramiko.</p>
  
  <pre><code>def ssh_login(self):
  
      try:
          cert = paramiko.RSAKey.from_private_key_file("key.pem")
          c = paramiko.SSHClient()
          c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
          print "connecting..."
          c.connect( hostname = "10.0.0.0", username = "example", pkey = cert )
          print "connected!!!"
          stdin, stdout, stderr = c.exec_command('ls')
          print stdout.readlines()
          c.close()
  
      except:
          print("Connection Failed!!!")
  </code></pre>