title: How to find the username of the instance launched in amazon-ec2?
body: <p>I m having trouble connecting to amazon ec2 instance using ssh. The key pair matches. 
  On google-ing a bit i find that username is not the same for all instances. I assumed its always ec2-user. How can I find the username of the instance that I have launched?</p>
  
  <p>I am getting this error:</p>
  
  <pre><code>Permission denied (publickey).
  </code></pre>
  
  <p>on trying this:</p>
  
  <pre><code>ssh -i test-instance.pem  ec2-user@23.22.214.148
  </code></pre>
  
  <p>Any help will be appreciated.</p>