VBox Guest: Local Port Forwarding SSH Access on Debian
In this article, we will discuss how to set up local port forwarding SSH access on a Debian guest operating system using VirtualBox with a NAT network adapter. By following the steps outlined below, you will be able to access your Debian VM's local host machine from your host machine.
Prerequisites
- A Debian guest operating system installed in VirtualBox
- A NAT network adapter configured for the Debian guest OS
- SSH installed on the Debian guest OS
Step 1: Configure VirtualBox Port Forwarding
To configure VirtualBox port forwarding, follow these steps:
- Open VirtualBox and select the Debian guest OS
- Click on "Settings" and then "Network"
- Select "NAT" as the network adapter type
- Click on the "Port Forwarding" button
- Add a new rule with the following settings:
- Name: SSH
- Protocol: TCP
- Host IP: 127.0.0.1
- Host Port: 2222
- Guest IP: (leave blank)
- Guest Port: 22
This will forward all incoming connections on the host machine's port 2222 to the Debian guest OS's port 22 (SSH).
Step 2: Connect to the Debian Guest OS via SSH
To connect to the Debian guest OS via SSH, follow these steps:
- Open a terminal window on your host machine
- Enter the following command:
ssh -p 2222 username@localhost
Replace "username" with your Debian user account name.
You should now be connected to the Debian guest OS via SSH using local port forwarding.
By following the steps outlined in this article, you have successfully set up local port forwarding SSH access on a Debian guest operating system using VirtualBox with a NAT network adapter. This allows you to access your Debian VM's local host machine from your host machine.