0

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

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.

  • Ok can you help me how can I disable the password prompt? – NSD Mar 3 '17 at 22:11
  • Yes I just ssh'd thank you for helping me. Just one more thing how can I disable the password prompt? – NSD Mar 3 '17 at 22:16
  • + is there a way that I can ssh from the virtual private network? virbr0 or something? – NSD Mar 3 '17 at 22:19
  • Nevermind I ssh'd cis virbr0 network. Is there any way to not enter the password? – NSD Mar 3 '17 at 22:27
  • disabling the password prompt is done via the ssh configuration files. stackoverflow.com/questions/20898384/… – 5_2_5_ Mar 3 '17 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.