title: Unable to connect via ssh with public key authentication method
body: <p>On my Windows 10, I am running into the problem of not being able to connect to m Vagrant virtual machine via ssh user with public key authentication method at git bash using command such as </p>
  
  <pre><code>$ ssh -v lauser@127.0.0.1 -p 2222 -i ~/.ssh/id_rsa
  </code></pre>
  
  <p>I would be prompted for password, as if the public key I copied to in the ~/.ssh/Authorized_keys file inside the vm were not seen. Meanwhile,the password authentication method works, as well as 'vagrant ssh'. 
  I have made sure to</p>
  
  <ol>
  <li><p>create key pairs locally, create a .ssh directory at the remote, and add pub key string to the remote's .ssh /authorized_keys file; both the .ssh and the .ssh /authorized_keys file are owned by the user(lauser), and set at 700 and 644 </p></li>
  <li><p>edit the /etc/ssh/sshd_config file on vm to use
  RSAAuthentication yes
  PubkeyAuthentication yes
  and restarted the sshd server (with 'sudo service ssh restart').</p></li>
  <li><p>verify that firewall has been disabled temporarily to eliminate any complication.</p></li>
  <li><p>verify that there is only one vm running, all others are either in 'suspend' or 'halt' mode.</p></li>
  <li><p>confirm the file type by 'file ~/.ssh/authorized_keys', and get confirmation '~/.ssh/authorized_keys: OpenSSH RSA public key'</p></li>
  <li><p>verify that the keys match by comparing the output from 'sudo cat ~/.ssh/authorized_keys' in vm and the output from ' cat ~/.ssh/id_rsa.pub' at the local.</p></li>
  </ol>
  
  <p>but still I get Permission denied (publickey) when trying to connect through public key authentication.</p>