ItSolutionStuff.com

How to Generate SSH Key in Ubuntu Server?

By Hardik Savani β€’ October 24, 2024
Git Ubuntu Server

Hi,

In this short tutorial we will cover an how to generate ssh key in ubuntu. We will use generate ssh key linux. you will learn generate ssh key ubuntu with email. you can understand a concept of copy ssh key ubuntu.

If you need to generate ssh key and add to your github, gitlab or any other account then i will help you how to generate ssh key in your ubuntu 22.10, ubuntu 22.04, ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04 and ubuntu 16.04 server. after that i will also give you step how to get generated ssh key and how to add ssh key in github account.

so let's see bellow commands for setup ssh key in ubuntu linux server.

Generate SSH Key in Ubuntu

Now, let's run bellow "ssh-keygen" command to generate ssh key.

Syntax:

ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"

Command:

ssh-keygen -t rsa -b 4096 -C "itsolutionstuff@gmail.com"

Now, you will see following layout as bellow:

Now, you can go ".ssh" folder and get ssh key from there:

cd ~/.ssh

ls

Now, you will see following layout as bellow:

cat id_rsa.pub

Now, you can copy your ssh key from here:

Add SSH Key in Github Account

Now, Here i will give you list of step how to add your generated ssh key into github account for now.

Step 1: Go to Github Account: Click Here. If you don't have account then you can create.

Step 2: Click to right side user icon and then click on Settings from list as bellow:

Step 3: Now click on Left side "SSH and GPG" list and click on New SSH Key button as like bellow:

Step 4: Next, add Title and Key then submit it:

Now you are ready to clone your github project in your server using following command:

Syntax:

git clone git@github.com:user_name/repo_name.git

Command:

git clone git@github.com:savanihd/Laravel-8-CRUD.git

Output:

i hope it can help you...

Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

πŸ“Ί Subscribe on YouTube

We Are Recommending You

β˜…

How to Set Up Password Authentication with Apache in Ubuntu?

Read Now β†’
β˜…

How to Install Apache PHP MySQL and Phpmyadmin on Ubuntu?

Read Now β†’
β˜…

How to Install Phpmyadmin in Ubuntu Server?

Read Now β†’
β˜…

How to ignore file permission (chmod) changes in git?

Read Now β†’
β˜…

How to Change GitHub Remote from HTTPS to SSH?

Read Now β†’
β˜…

How to Merge Your Branch to main Branch in Github?

Read Now β†’
β˜…

Git Command to Ignore File Permission Changes

Read Now β†’
β˜…

How to Add Git Add Remote Origin on Bitbucket Repository?

Read Now β†’
β˜…

Git - How to Find a Deleted File in Commit History?

Read Now β†’
β˜…

How to Configure Git Username and Email?

Read Now β†’
β˜…

How to Git Force Pull from Remote Branch?

Read Now β†’