How can I ssh from my virtual machine to the local host?
I need exact details please.
Note: Virtual machine = Ubuntu 14 Host machine = Ubuntu 16
Thanks.
1 Answer
Using ssh from your VM to the localhost on your host machine will use the host machine address. Open a terminal on the Host (Ctrl + t) and type ifconfig
look for something like inet addr:192.168.XX.XX and then ssh to that address.
Be sure to ensure your host firewall settings are going to allow ssh in from only specified addresses on port 22. Assuming you have ssh set up to listen in its default manner - You can control firewall settings in Ubuntu using the ufw command. like this on the Host:
sudo ufw enable
sudo ufw allow proto ssh from 192.168.1.100 to 192.168.1.110 port 22
Then from your VM for example:
sshhost_username@192.168.1.XX
This type of connection happens over the network rather than through a socket on your host machine. In a scenario where you are still unable to ssh to your host machines address, check your LAN router, switch, or firewall to see if it is preventing ssh on your internal network.
7