How to Set Up SSH Keys on Ubuntu

SSH or secure shell is an encrypted protocol used to communicate and administer with the servers. It follows simple steps to generate on ubuntu. Generating ssh keys in ubuntu, the windows operating system is moreover similar.

How to Set Up SSH Keys on Ubuntu


Introduction

​SSH or secure shell is an encrypted protocol used to communicate and administer with the servers. It is mostly used in providing extra security to the servers while communicating with different client machines.​

When working with an Ubuntu server, chances are you will spend most of your time in a terminal session connected to your server through SSH.

In this guide, we’ll focus on setting up SSH keys for Ubuntu operating system. SSH keys provide an easy, secure way of logging into your server and are recommended for all users.

Create Ssh key

create a key pair in your machine or computer using the following command

ssh-keygen

then press enter, enter until you get your terminal back

By default, ssh-keygen will create a 2048-bit RSA key pair, which is secure enough for most use cases (you may optionally pass in the -b 4096 flag to create a larger 4096-bit key).

After entering the command, your key will generate and saved on your machine. which you can output using the following command:

Outputting Ssh key

cat ~/.ssh/id_rsa.pub

Press enter, then you will get the ssh key output, which you can use to communicate with the server.

Reference: https://www.digitalocean.com/


Related tags