Linux Tutorials: How to setup SSH keys on Ubuntu/ Linux

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare

Introduction:

SSH, or secure shell, is an encrypted protocol used to administer and communicate with servers. 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 an Ubuntu 20.04 installation. SSH keys provide a secure way of logging into your server and are recommended for all users.

Steps:

  • Login to the Ubuntu machine using SSH client like Putty
  • Run: sudo -s (This is to be a root user)
  • Run: cd /root/
  • Verify if .ssh file exists in the /root dir
  • Generate SSH Key. Command: ssh-keygen
  •  Move to /root/.ssh directory, Command: cd .ssh
  • Verify if the id_rsa.pub was created successfully using command: ls
  • Reterive the public ssh key to add it in gitlab, github or butbucket using command more id_rsa.pub
    You can simply copy the key and add them in gitlab, github or butbucket
  •  Git clone to check if you are able to clone the directory after adding the key in gitlab, github or butbucket using commands:

exit
sudo git clone git@<Your_Repository_SSH_Clone_URL>

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x