Setup Ssh Ubuntu 20.04



This quick tip shows how to enable Secure Shell (SSH) service in Ubuntu 20.04 LTS, both desktop and server, to allow secure remote login and other network communications. Ubuntu includes OpenSSH, a. Learn Linux Server Administration Ubuntu 20.04 Latest Version. Setup SSH Key Authentication Windows. SSH is an encrypted networking tool that lets you log in securely to computers remotely over a network. Here's how to set up and enable SSH on Ubuntu.

This brief tutorial shows students and new users how to setup two-factor or multi-factor authentication for SSH on Ubuntu 20.04 | 18.04 using Google Authenticator.

  1. This tutorial will guide you on the first basic steps you need to configure on a new installed Ubuntu server in order to increase security and reliability for your server.
  2. The Ubuntu Server 20.04 LTS image should be selected. Click on the CHOOSE SD CARD button as marked in the screenshot below. Click on the microSD card from the list that you want to flash the Ubuntu Server 20.04 LTS image. To write the Ubuntu Server 20.04 LTS image on your selected microSD card, click on WRITE.

If you’re accessing your server via SSH remotely and you want to add another layer of security to make sure it’s unauthorized user agents and threat actors can’t login, then adding two-factor authentication is a great move.

Two-factor authentication enables users to provide certain details such as random code, or OTP ( One Time Password ) to add another layer of security to standard username and password.

We previously showed you how to set up two factor authentication with Ubuntu using Google Authenticator.

To read this post, click here.

To get started with setting up two-factor authentication for SSH on Ubuntu using Google authenticator, follow the steps below:

Install Google Authenticator

Before you can configure SSH server to enable two-factor or multi-factor access, you must first install Google Authentication.

Since we’ve already showed you how to install Google Authenticator Ubuntu and set up on your mobile device, please reference the post below so we don’t write it again.

After setting up the steps above, continue below.

Configure Two-factor SSH

Setup Ssh On Ubuntu 20.04

Now that you have installed Google Authenticator on Ubuntu and your mobile device, continue below configure SSH server to use it.

To setup SSH run the commands below to open its default configuration file on Ubuntu.

Next, make the highlighted changes in the file to make this to work.

Save and exit.

Next, run the commands below to open the PAM SSH configuration file in Ubuntu.

Then append the highlighted changes below and save.

Save the file and exit.

After making the changes above, restart SSH servr.

Now go and test out. You should be prompted for a one time code everytime you attempt to sign in.

If you setup SSH public key authentication, then you’ll want to add this line in the main SSH configuration file at /etc/ssh/sshd_config file.

Then make sure this is included in the PAM SSH rule file at /etc/pam.d/sshd file.

Setup Ssh Keys Ubuntu 20.04

Setup Ssh Ubuntu 20.04

Exit both files and save your changes then restart SSH.

That should do it!

Conclusion:

This post showed you how to configure SSH to accept two-factor authentication using Google Authenticator.

Config Ssh Ubuntu 20.04

If you find any error above, please use the form below to report.

Install Ssh On Ubuntu 20

You may also like the post below: