SSH is a secure tool that helps to establish secure communication between the client and server over an insecure network. Without a properly configured SSH connection, an attacker may be able to access your data across the network and damage your apps. The data sent over the network is encrypted and decrypted by SSH using RSA and other asymmetric encryption algorithms.

  1. Open a Terminal window and type the following command to change the default SSH port on your Ubuntu server: sudo port-forward ssh
  2. Type the following command to enable SSH into a virtualBox Ubuntu Server:
  3. Type the following command to start your Ubuntu server with SSH enabled:
  4. To finish, type the following command to exit your Terminal window:

Ways to Enable SSH Into a VirtualBox Ubuntu Server

Installing SSH on the Virtual Machine

SSH is a secure, remote access protocol used to connect two systems. It is commonly used to connect to servers and work with files on other computers. SSH can be used in full-fledged desktop environments or as a standalone application. Additionally, an SSH client must be installed on the PC from which you are opening the SSH connection in order to use it.

  1. Launch VirtualBox and then start your Ubuntu virtual machine from the GUI.
  2. In the VirtualBox window, select Ubuntu as the guest operating system.
  3. Click on the OK button to close VirtualBox and return to the main Ubuntu window.

ssh -i /etc/ssh/sshd_config

ssh -l This will show you the current state of your SSH server.

If the SSH port is not enabled on your firewall, use the UFW tool to enable the SSH port.

Configuring the VirtualBox Network

Each virtual machine created by VirtualBox automatically creates a Network Address Translation (NAT) adapter. This permits your virtual machine to connect to the internet but blocks SSH access from other devices. You must use VirtualBox port forwarding and the default NAT adapter your VM is connected to configure the network. Although that’s a topic for another day, keep in mind that VirtualBox offers a wide range of additional networking configuration options, such as a bridged adapter that you can use to SSH into guest operating systems.

In the Settings window, you can change the network adapter to which you want to SSH into. You can also choose whether you want to use a public or private network.

You can configure your port forwarding rules to forward traffic from your computer to a virtual machine on another computer by using the VirtualBox port forwarding screen.

Final Words

To enable SSH access into a VirtualBox Ubuntu Server, you will first need to install the VirtualBox Guest Additions. This is a software package that provides guest OSes with the ability to access host OS resources. After installing the Guest Additions, open VirtualBox and click on the “Settings” button in the toolbar. In the “Settings” window, click on the “Network” tab and select the “Adapter 1” network card from the list. Underneath this network card, click on the “Security” tab and select “Enable SSH” from the list. Finally, enter your username and password for your Ubuntu Server in the appropriate fields and click on OK. ..