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.

Chetan