I have a Ubuntu running inside a VirtualBox inside my Windows 8 desktop. I am trying to communicate between the Ubuntu and another Debian server in the network.
I have enabled Port Forwarding in VirtualBox and I am able to ssh to and from the virtual Ubuntu using a password.
I want to set up publickey authentication but I am running into issues.
Steps done so far -
- Port forwarding in VirtualBox. Configured ports 22 to be forwarded to the VirtualBox and ssh with password works.
- Generated public private key pair in Ubuntu and copied id_rsa.pub to authorized keys in the Debian server
- Generated public private key pair in Debian server and copied id_rsa.pub to authorized keys in the Ubuntu
- Generated public private key pair using PuttyGen in windows 8 and copied public key to authorized keys in Debian server
- Changed network settings in VirtualBox into 'Bridged Adapter'. The IP address of the virtual box changed from the private VirtualBox IP to a public IP. But I am not able to ping the Debian Server now. Changed it back to NAT
- Changed sshd_config in the Debain server to not accept passwords and use only publickey authentication - now Ubuntu is not able to communicate with the Debain with "Permission denied (publickey)" error.
Can someone please point out if I am missing some steps or doing something wrong.
Any help is greatly appreciated.