Categories: Ubuntu

How to Install and Enable OpenSSH on Ubuntu 22.04

Secure Shell Protocol aka SSH is referred to as a cryptographic network communication protocol that permits secure communication and exchange of data between two devices over an unsecured network. Users use SSH to log in to applications or execute command lines on terminals remotely. For devices to build a connection, both need to have SSH installed and working on their systems.

If you’re looking for a way to install and enable OpenSSH on Ubuntu 22.04, then follow the provided guide below.

How to Install and Enable OpenSSH on Ubuntu 22.04

In this section, we will provide a step-by-step guide that will help you to install and enable OpenSSH on Ubuntu 22.04. So, let’s start!

Step
Sponsored
1: System Update

Before you begin the installation of OpenSSH, firstly, open up the Ubuntu 22.04 terminal by pressing “CTRL+ALT+T” and confirm that your system is up to date:

$ sudo apt update && sudo apt upgrade

Output

Step 2: Install OpenSSH

OpenSSH is not present on the system by default, therefore, run this command to initiate the OpenSSH installation procedure on Ubuntu 22.04:

$ sudo apt install openssh-server

The below-given output indicates that we have successfully installed OpenSSH on our Ubuntu 22.04 system:

Step 3: Enable OpenSSH

After successful installation of OpenSSH, you need to enable it on Ubuntu 22.04 by utilizing the following command:

$ sudo systemctl enable –now ssh

Output

Sponsored

Step 4: Evaluate OpenSSH Status

Next, validate that the OpenSSH is working properly and there are no issues with the help of the following “systemctl” command:

$ sudo systemctl status ssh

As you can see from the output, OpenSSH is currently active and running on our Ubuntu 22.04 system:

Step 5: Connect to SSH Server

Once you have installed OpenSSH and it is in a working state, you can now connect your system to another remote system, computer, or server. However, you have to make sure that OpenSSH is installed and enabled on that remote system as well.

Before you connect to a server, you need to have an internal/external IP address or a hostname or username of the account you want to connect to; then run the below-given command

$ ssh username@ip-address/hostname

Step 6: Disabling OpenSSH

When you do not want to use OpenSSH, then you should disable it for security purposes to avoid being detected from any malicious bots. To do so, execute the following command in Ubuntu 22.04 terminal:

$ sudo systemctl disable ssh –now

Output

We have compiled the easiest method to install and enable OpenSSH on Ubuntu 22.04.

Conclusion

For the purpose of installing and enabling OpenSSH on Ubuntu 22.04 requires you to first update your system and then install OpenSSH using the apt package. Once installed, you have to enable it and evaluate its status and see if there are any issues present or not. Finally, after enabling OpenSSH, you can connect to other devices that have OpenSSH installed and enabled on their systems. This write-up demonstrated the procedure to install and enable OpenSSH on Ubuntu 22.04.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

5 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

1 day ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago