Enabling SSH on Ubuntu

sudo apt update
sudo apt install openssh-server

Enter the password when prompted and enter Y to continue with the installation.

sudo systemctl status ssh

You should see something like Active: active (running)

Ubuntu comes with a firewall configuration tool called UFW. If the firewall is enabled on your system, make sure to open the SSH port:

sudo ufw allow ssh