Install OpenSSH Server on Ubuntu

Secure Shell (SSH) is a fundamental tool for managing Linux servers remotely. This article provides a quick and direct guide on how to install and enable the OpenSSH server on Ubuntu Linux, ensuring you can securely connect to your machine from anywhere.

To install the OpenSSH server on Ubuntu Linux, you need to use the apt package manager. Open your terminal and run the following command:

sudo apt install openssh-server

Step-by-Step Installation Process

For a successful setup, follow these quick steps:

1. Update the Package List

Before installing any new packages, update your local package index to ensure you fetch the latest version from the Ubuntu repositories:

sudo apt update

2. Run the Installation Command

Install the OpenSSH server package by executing:

sudo apt install openssh-server

When prompted, type Y and press Enter to confirm the installation.

3. Verify the SSH Service Status

The SSH service starts automatically upon installation. You can verify that the service is active and running with the following command:

sudo systemctl status ssh

You should see active (running) in the command output.

4. Configure the Firewall

If you have the Uncomplicated Firewall (UFW) enabled on your Ubuntu system, you must allow SSH connections. Enable the SSH rule by running:

sudo ufw allow ssh

To apply the changes, reload the firewall:

sudo ufw reload

Your Ubuntu system is now ready to accept secure remote connections. You can connect to it from another machine using the command ssh username@ip_address.