Setup ssh to connect to remote server and github repo access

It's just a simple thing to do, alas I spend hours getting this right cause of not getting basics right. So here it goes a simple set of instructions to set up ssh access to your remote server and setup access to github repository for code deployment.

Step 1

First, visit this link and check if you already have ssh key generated, if not follow the instruction for the same to generate ssh keys. Checking for existing SSH keys

Step 2

Copy the contents of any .pub file based on the instruction followed from above link.

Step 3

Login to your remote server using following command and enter your password.


Step 4

Check if .ssh folder is present in your remote server, if not using this command to create a directory

mkdir .ssh

Post that create a file called authorized_keys. Once done, enter the following command to open the file

nano ~/.ssh/authorized_keys

Copy the contents of the .pub file and save it. Once you are done, exit from the remote server and try to connect through ssh without using password by using this command again.


Step 5

This step is to connect to github repository for code deployment to remote server, first generate ssh key using Step 1 in your remote server, copy .pub file contents generated. Than go to this link and follow instruction Adding a new SSH key to your GitHub account

I hope it help save lot of hours of yours.

Thanks for your time to read, appericiate it.

Mannan Shah | Have a good Friday