How to Install OpenSSH on Ubuntu 20.04

What is OpenSSH?

OpenSSH is a connectivity tool that allows secure communication between client and server. The traffic is encrypted to discourage eavesdropping, connection hijacking, MITM attack, and other attacks.

In today’s guide, we will show you how to install OpenSSH server on an ubuntu machine. The installation will take place using the terminal with the help of a few easy-to-follow commands.

Let’s get started!

Installation Guide:

Following are the steps involved in installing OpenSSH server in Ubuntu:

Step 1: Install OpenSSH Server

To install OpenSSH server, issue the following command:

sudo apt-get install openssh-server

Step
Sponsored
2: Enable SSH

In this step, we will enable SSH to allow log in from remote machines. It can be done by running the following command:

sudo systemctl enable ssh

Step 3: Start SSH

Now that we have enabled the service, let’s start it. To do that, run this command:

sudo systemctl start ssh

Step 4: Test SSH Login

Now we will check whether we can access the server via ssh from a remote machine or not. To do that, log in to the system using your username and the IP address of the server machine.

ssh tom@10.254.153.43

OpenSSH server installation and configuration

SSH to remote server using bmc/kvm/ipmi over IP

We are using OpenPOWER based system known as Talos II from Raptor computing systems. Since it does not come with SSH server installed on it, this is how we will log in to bmc server to get access to the serial console.

ssh root@power9-bmc

Run obmc console

To get access to the Ubuntu server console, run the obmc-console-client by executing this command:

# obmc-console-client

Install OpenSSH server on Ubuntu

Step 1: Update the system

Firstly, update the system. To do that, execute the following command:

sudo apt update

Step 2: Upgrade the system

After updating, we will upgrade the system. Run the following command to do that:

sudo apt upgrade

Step 3: Install sshd server on Ubuntu

In this step, we will install the openssh-server package by issuing the following command:

sudo apt install openssh-server

Step 4: Check the status of the service

Let’s verify whether the ssh service is running fine or not. Run this command to do that:

Sponsored
sudo systemctl status ssh

Step 5: Enable and start SSH

Now, let’s run the SSH service. First, enable it by running the following command:

sudo systemctl enable ssh

Once the service is enabled, start the service by issuing the following command:

sudo systemctl start ssh

Configure Firewall and open port 22

We also need to allow SSH service through firewall. To do that, we will configure ufw, the firewall present in Ubuntu.

Allow SSH

To allow SSH on ufw, run this command:

sudo ufw allow ssh

Enable SSH

Next, we will enable SSH. It can be done by running the following command:

sudo ufw enable

Check firewall status

Now check the status of the ufw firewall by running the following command:

sudo ufw status

Test SSH login

SSH to the OpenSSH server

You can now log in OpenSSH server from a desktop machine using SSH. It can be done this way:

ssh tom@10.254.153.43

ssh tom@power9

Enable password less access

To allow password less login, you can copy and install the public key using ssh-copy-id command like this:

ssh-copy-id tom@power9

That’s all folks!

In this tutorial, we had a thorough look at how to install OpenSSH server on Ubuntu 20.04. We also saw how we can configure it for remote access and how to allow SSH service through Ubuntu’s firewall.

I hope you had a great learning time here.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

8 hours ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

24 hours ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

1 day ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

2 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

3 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

4 days ago