Follow the below steps for adding a new ssh key in Github account.
1. Check Available SSH Keys
Log in to your Unix/Linux system and open a terminal. Check ~/.ssh/ directory for existing ssh key files in your system. If the system already have key pair files, you can use them to configure with Github. In my case, the files already exists.
2. Generate a New SSH Key
If no SSH key pair is available, use the ssh-keygen command-line tool to generate a new key. Open a terminal and type: Hit enter for any input prompted by command: Thats it. Now, you will see two key files created under ~/.ssh directory. One is the private key (id_rsa) and other is the public key (id_rsa.pub). Keep the private key file secured and don’t share with anyone.
3. Add SSH Key to Github Account
As you have created a SSH key pair on your system. Copy the content of public key (file with .pub extension) and follow the below steps to add ssh key in Github account.
4. Test Setup
To verify settings, just clone any repository accessible to your account with Git url. For example: This will authenticate the request using SSH key pair. On successful authentication the repository will cloned in your system.
Conclusion
In this tutorial, you have learn to configure SSH key to your Github account.