Open Ubuntu machine and navigate to the terminal
Make sure your OS is up-to-date:
sudo apt update
sudo apt full-upgrade -y --fix-broken
Install openssh-server:
sudo apt install openssh-server
Check Installation:
sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh
Open Ubuntu machine and navigate to the terminal, Enter the following command:
sudo apt install ufw
sudo systemctl start ufw
sudo systemctl enable ufw
sudo ufw enable
sudo ufw allow ssh