Skip to main content

Generate SSH keys on linux

My work often requires me to use git and github for version control. So when you first clone a repository to your local hdd , you are required to enter your github username and password everytime when you want to push stuff to that repo. This can be quite cumbersome for someone like me who prefers to push stuff quite often. (as the old adage goes,' It's better to be safe than sorry')

A better way is to use ssh keys to authenticate your local machine so that you can skip the verification everytime when you push stuff. The way to do this is to use ssh when cloning the repo in the first place. When you click on the dropdown button 'Clone or download' on github, you're given the options to clone using https and ssh. Choose ssh to clone.
Then on your local machine fire up the terminal (press ctrl+alt+t).
change to your home directory(cd ~) and type in the following command :
ssh-keygen -t rsa -C "your@email.here"
This will generate the ssh keys in /home/user/.ssh/id_rsa.pub
Now in github, go to settings  and click on 'SSH keys and GPG Keys'.Click on 'New SSH key' and paste the contents of the id_rsa.pub here. You are all set !

Comments

Popular posts from this blog

What does sudo apt-get autoremove do ?

sudo apt-get autoremove Whenever you install an application (using  apt-get ) the system will also install the software that this application depends on. It is common in Ubuntu/Linux that applications share the same libraries. When you remove the appplication the dependency will stay on your system. So  apt-get autoremove  will remove those dependencies that were installed with applications and that are no longer used by anything else on the system.