How to Enable SSH on Ubuntu 18.04

Secure Shell (SSH) is a cryptographic network protocol for operating network services securely such as login, remote command-line execution, and transfer files securely. To enable SSH server on Ubuntu desktop machine, you need to be logged in as a user with sudo privileges.

SSH server is not installed by default on Ubuntu desktop operating system, So you need to install it from the standard Ubuntu repositories.

We will guide you to install SSH server on your machine in the following steps:

1- Open terminal by pressing Ctrl+Alt+T on the keyboard or by clicking on the terminal icon and type the following commands:

$ sudo apt update
$ sudo apt install openssh-server

Enter the password and type y to agree for the installation.

ssh installation

2- After the installation is completed, SSH service will start automatically. However, if you want to verify it is running you can type the following command in the terminal that will prompt you the status of the service:

$ sudo systemctl status ssh

If it says Active: active (running) so the service is up.

ssh status

press q or Ctrl + c to exit and get back to the prompt.

3- Open SSH server port through Ubuntu firewall(UFW) if it is enabled, using the following command:

$ sudo ufw allow ssh

Now you have SSH server installed and enabled on your Ubuntu machine, you can login to it using any remote SSH client.

Additional commands

If you want to disable SSH, you can stop SSH service by typing:

$ sudo systemctl stop ssh

To start the service again:

$ sudo systemctl start ssh

And if you want to disable the SSH service from starting during system boot:

$ sudo systemctl disable ssh

To re-enable it:

$ sudo systemctl enable ssh

To learn more about configuring your SSH server visit Ubuntu’s OpenSSH Configuring page. Also you may visit the official OpenSSH manual page for more information.

Also, if you want to learn how to setup SSH key-based authentication, check out this article.

We hope you find this article helpful and if you have any question, leave a comment below.

Other articles you may find interesting

managed vs unmanaged switches
In general, network switches are the main building block of wired computer networks. It’s the networking hardware that connects other…
Read More
how to turn ESP32 into NAT router repeater
ESP32 development board can be used as WiFi router/repeater with NAT(Network Address Translation), thanks to martin-ger, who developed this great…
Read More
turn any website into separate native application
As a Windows user, I do most of my work on my PC using a browser, not because I prefer…
Read More
how to transfer files remotely via SSH
SSH or Secure Shell is a protocol that allows a secure connection to the remote computer. There are multiple methods…
Read More
In this article you will learn how to link a domain to Vultr server. So, you can connect to it…
Read More
Secure Shell supports various authentication mechanisms. The two most used methods are: Password based authenticationPublic SSH key authentication In this…
Read More


Leave a Reply

Your email address will not be published. Required fields are marked *