title: Unable to connect to EC2 Linux instance from Windows 10 CMD using ssh
body: <p>I have a running <code>EC2</code> instance that is running <code>Linux OS</code>(<code>Amazon Linux AMI release 2018.03</code>) on it.</p>
  
  <p>Given that <code>Windows 10</code> has <code>SSH</code> client available in the command prompt, I was trying to <code>SSH</code> into my <code>EC2</code> instance using the <code>SSH</code> private key(<code>.pem</code> file) provided by <code>AWS</code> as a key pair during the setup of the <code>EC2</code> instance.</p>
  
  <p>The command I am using on <code>cmd</code> is :</p>
  
  <pre><code>ssh -i private_key.pem ec2-user@3.133.96.240
  </code></pre>
  
  <p>Here <code>private_key.pem</code> is the name of the private key file provided by <code>AWS</code>.</p>
  
  <p>But I keep getting the error:</p>
  
  <pre><code>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  Permissions for 'private_key.pem' are too open.
  It is required that your private key files are NOT accessible by others.
  This private key will be ignored.
  Load key "private_key.pem": bad permissions
  ec2-user@3.133.96.240: Permission denied (publickey).
  </code></pre>
  
  <p>Some things I would like to clarify:</p>
  
  <ol>
  <li><p>There are similar questions on StackOverflow. Those questions actually involve trying to connect to the <code>EC2</code> instance from a host that is running <code>MacOS</code>/<code>Linux</code>(any <code>UNIX</code> based OS). In my case I am trying to connect from <code>Windows</code> 10 host using command prompt.</p></li>
  <li><p>In answer to such other questions as discussed in (1), people have suggested trying to change the file permission of the private key file(<code>.pem</code>) file to read-only(<code>chmod 444 file.pem</code>). In response, I tried making my <code>.pem</code> file as read-only from the file properties in my <code>Windows</code>. This did not help. I keep getting the same error.</p></li>
  <li><p>I am able to connect to other remote Linux hosts from my Windows 10 cmd, which suggests there is probably no problem with my Windows 10 SSH client.</p></li>
  <li><p>I know this connection can be made easier by using <code>Putty</code> instead of <code>CMD</code>, but that is not what this question is about. Just assume because of some constraints I cant use <code>Putty</code>.</p></li>
  </ol>
  
  <p>Any help would be appreciated.</p>