Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

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

Introduction:
If you want to clone a repository from gitlab, github or bitbucket in your Ubuntu machine then you may need to setup SSH Keys in ubuntu and add that key to gitlab, github or bitbucket to make the repository accessible from Ubuntu machine.

Steps:
1. Login to the Ubuntu machine using SSH client like Putty
2. Run: sudo -s (This is to be a root user)
3. Run: cd /root/

4. Verify if .ssh file exists in the /root dir

5. Generate SSH Key. Command: ssh-keygen

6. Move to /root/.ssh directory, Command: cd .ssh

7. Verify if the id_rsa.pub was created successfully using command: ls

8. 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

9. 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>

Thanks for reading, I hope you enjoyed the article.

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.