Generate ssh key for Github Account

Github is a place where people can share the code and can develop project by coordinating contribution from different sources.It is a nice version manager tool.

To add code to the github account safely we need authorization mechanism.By generating ssh key, we can make sure that codes are added only from safer zones(with our prior knowledge).SSH will generate one private key and public key, the public key we have to add in online github account.Let us see how to generate the keys:

To create key, we need ssh to be installed in our system.


1) ssh-keygen -t rsa -C “your-email”

Enter the file path where this has to be saved, by default it will save in “home/username/.ssh” folder.Also enter the pass phrase for the key (optional). Now one private and public key will be generated in the specified folder.

2) ssh-add ~/.ssh/id-rsa

This code will add the recently created ssh key to ssh agent.

3)Now we have to add the public key of the key pair to github account.Open your github account in browser and click on account settings.There we can see “SSH Keys” option.Now select add ssh key option and paste the content of public key (~/.ssh/ can open public key in any editor and copy the contents to paste it in github account.

4) ssh -T

Now, its time to check whether it is working properly.This command will try to establish connection with through ssh.If you get success message, then its done perfectly.

I am done with my github account  .

“Hi ashiksp! You’ve successfully authenticated”

Refer this  for detailed information.

Happy Hacking… 🙂

About ashiksp

computer science & Engg student , N.S.S College of engineering palakkad
This entry was posted in Techy and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s