Cyberithub

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04)

In this tutorial, I will take you through the steps to enable ssh on Ubuntu(18.04/17.04/16.04). OpenSSH is a freely available version of the Secure Shell (SSH) protocol family of tools for remotely controlling, or transferring files between, computers.

Traditional tools used to accomplish these functions, such as telnet or rcp, are insecure and transmit the user’s password in cleartext when used. OpenSSH provides a server daemon and client tools to facilitate secure, encrypted remote control and file transfer operations, effectively replacing the legacy tools.

Enable ssh on Ubuntu

In this example, we will use test user with sudo privileges.

Prerequisites

Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 1

 

Step 1: Update the System

First we need to update the System using sudo apt-get update command. Make sure to take backup of all of your applications and files to avoid any issue before running the update.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 2

Step 2: Install Openssh

Then Install Openssh package using sudo apt-get install openssh-server command.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 3

Step 3: Check the Service

Once Installation completed successfully, check the server status through sudo service sshd status. If the service is not running or not started you can do sudo service sshd restart/start to start the service.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 4

Step 4: Verify the ssh connection locally

Since sshd service is running now, we can try to login to this node locally by using ssh localhost command.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 5

Note: Sometimes, it shows Connection refused when port 22 is not allowed through Server. In that case, you need to allow it through Server using sudo ufw allow 22 command.

How to Install or Enable ssh on Ubuntu(18.04/17.04/16.04) 6

Also Read: Upgrade CentOS 7

Reference: Ubuntu OpenSSH Server

Leave a Comment