First, update the package manager cache by running
sudo apt update
install openssh-server
sudo apt install openssh-server
Once the installation is complete, the SSH service will start automatically. You can verify that SSH is running by typing:
sudo systemctl status ssh
output
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-01 12:34:00 CEST; 9h ago
...
Ubuntu ships 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
Connecting to the SSH Server #
To connect to your Ubuntu machine over LAN invoke the ssh command followed by the username and the IP address in the following format:
ssh username@ip_address