I am trying to setup password less login from my Mac OS X to to Ubuntu VM created by Virtual-box. I am using NAT->port forwarding option in VM and have host port as 3022. When I do
ssh -p 3022 ubuntu@127.0.0.1
from my local and I can able to login to ubuntu with password, and this works vice versa.
Now I have created public/private key file in my Mac and copied the pub key to VM (ubuntu/.ssh/authorized_keys)
So now when I do:
ssh -p 3022 ubuntu@127.0.0.1
and it's asking for the password again.
I verified the key from id_rsa.pub vs VM authorized_keys and key is same in both places
Can someone tell me if I am making any mistake in my steps?
ssh -p 3022 -i /path/to/private_key ubuntu@127.0.0.1– ecube Mar 10 '16 at 00:37-vvto your ssh command, this should give you a lot of verbose output, that will help you troubleshoot. Also look at your /var/log/auth.log on the Ubuntu server. – Zoredache Mar 10 '16 at 00:37ssh-copy-id, so it'll copy and configure RSA key for you. – kenorb Mar 10 '16 at 00:38~/.ssh/authorized_keysfile. – SaxDaddy Mar 10 '16 at 00:56ubuntuon your server so either create such a user or log in as some existing user. – Jakuje Mar 10 '16 at 18:07