Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SofijaErkin/b2621766f9f1804a084e127793725424 to your computer and use it in GitHub Desktop.
Save SofijaErkin/b2621766f9f1804a084e127793725424 to your computer and use it in GitHub Desktop.
remote login between virtual machine linux and host with NAT connection via port fowarding using ssh

NAT SSH Login Between VM Linux and Host macOS

I have a macbook, and I need to write server project, so I have to install

VirtualBox on my macbook, also, I enjoy wandering into Debian,. Again, I

have install and config Debian into VirtualBox.

0.My Question

Now, my question are: I have needed to login VirtualBox's Debian in my macbook

terminal; As the same time, I have enough interests on logging into macbook

with my VirtualBox Debian's terminal.

1.My Network Environment

I've just set NAT connection between my VirtualBox Debian and macbook. In NAT

status, that the virtual machine could access the host machine via

ssh [email protected], while the host machine need to

set port forwarding to access the virtual machine via

ssh -p port_forwarding_port [email protected].

As the below image show:

NAT Connection

3.RoadMap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment