How to Generate SSH Key in Linux

In this quick tutorial i will let you know how to generate SSH key through command line and add into your git account. This key help to authorize your computer to access GIT repository using SSH. When you access a repository which is not public then you will get ‘right access permissions’ error on GIT bash.

How to Generate ssh Key in Windows

1- Open Git Bash command line that’s is exist on GIT directory(Git->Git Bash).
2- write ssh-keygen -t rsa on git bash cmd window, it will ask password and key name, Enter your password and key name.
3- Above command will show where file was saved in your computer.

How to Generate SSH Key in Linux

1- I assume you have installed GIT of Linux box.
2- write ssh-keygen -t rsa, it will ask password and key name, Enter your password and key name.
3- Above command will show where file was saved in your computer.

Add SSH Key on Your GIT Profile

1- Login your GIT account.
2- Navigate your profile and select edit mode.
3- Click SSH key tab and click 'Add SSH Key' button.
4- Now Open file your_home_directory/.ssh/id_rsa.pub on your text editor, and copy contents and paste into your key textarea.

key_paste on git

If your getting error on saving process that’s means you have copy any spaces with key.

Conclusion

We have generated ssh key on linux as well as on windows.We have created ssh private/public key and added into GIT profile to authorize your computer to access GIT repository using SSH, to generate SSH key in linux/widnows You need to follow above steps.