Command SSH key generate in ubuntu server

  • 25-12-2022
  • 468
  • Ubuntu
  • Haresh Chauhan

How to Generate SSH Key in Ubuntu Server? in this post I will provide a command guideline for generating an ssh key in the ubuntu server. we will generate an ssh key in the ubuntu server with the help of your email address.

We will generate an ssh key using the email address in the ubuntu server. This ssh key will help you when you required basic authentication like GitLab, a GitHub account with your server.

If you required basic authentication with your server to GitHub and GitLab or any other account with your server this ssh key will help you to make basic auth with your server.

This guideline will help you to generate an ssh key with your help of email address in different ubuntu versions ubuntu 22.10, ubuntu 22.04, ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04, and ubuntu 16.04 server. so let's start generating the ssh key Linux ubuntu server.

Generate SSH Key in Linux Ubuntu

Open your ubuntu server command prompt and paste this command in your command prompt, also set your email address to is provided command, after setting your email address in the command run this command in your terminal, and hit enter in every asked question.

ssh-keygen -t rsa -b 4096 -C ""

After hitting provided command in your server command prompt, you will see an interface like the below attached image in your terminal.

Command SSH key generate in ubuntu server

After successfully generate ssh key in the ubuntu server we will go to the key directory and list it in the terminal. So press provided command in command prompt and hit enter.

cd ~/.ssh

After that we will list it in the terminal whether the key is generated or not, it generated the key you will see the list name in the command prompt.


Enter provided command in your terminal, you will see your ssh key in the command prompt.


You will see something like this in your terminal, you will see below-attached image key in your terminal. just copy and make it authentication where you want to use it, that's it.

Command SSH key generate in ubuntu server

We always thanks to you for reading our blogs.


Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us


Haresh Chauhan


We Are Also Recommending You :