How to enable SSH service on Ubuntu 20.04

This quick tip shows how to enable the Secure Shell (SSH) service on Ubuntu 20.04 LTS on both desktops and servers to enable secure remote login and other network communications.

Ubuntu’s main repository contains OpenSSH, a suite of secure network utilities based on the Secure Shell protocol. The OpenSSH client is installed as-is, but you can perform the following steps to install and set up the OpenSSH server on Ubuntu 20.04.

1. First open a terminal and run the command to install the package.

sudo apt install ssh

Type the user password for the sudo prompt (without asterisk feedback) and press Enter.

How to enable SSH service on Ubuntu 20.04

2. Once installed, the SSH service will start silently in the background. You can check the status by running the following command.

systemctl status ssh.service

You can exchange status In code stop, reload, restart Stop, reload, or restart the service.

How to enable SSH service on Ubuntu 20.04

3. The SSH service is now ready for use. If you want to change the listening port, root login permissions, or any other authentication, run the command to edit the configuration file.

sudo nano /etc/ssh/sshd_config

Replace nano When gedit If you are using Ubuntu desktop.

How to enable SSH service on Ubuntu 20.04

Press Ctrl + X, Y to save your changes and finally press Enter. And don’t forget to restart the SSH service sudo systemctl restart ssh.service command.

Sidebar