Home Password-less for connecting Github and remote server
Post
Cancel

Password-less for connecting Github and remote server

I used to enter the password when pushing file to Github or connecting to remote server. I always feel this step redundant and recently came to konw that SSH is a good solution. I want to record these steps in case of need later.

SSH for Github

  1. Running the following command:
1
2
ssh-keygen -t rsa
<keep clicking 'Enter' if system asks you for actions>

You can also add -C "your_email@example.com" at the end of ssh-keygen -t rsa to make a copy of the ssh-key by email.

  1. Check your ~/.ssh folder and there is a id_rsa.pub
  2. Add the key to github account.
  3. Change to the git repo folder and run: git remote set-url origin git@github.com:username/your-repository.git, here the origin could also be master.
  4. Then try git push and this time it shouldn’t require you to enter password anymore.

Remote Server

  1. If you already have a key, then run ssh-copy-id <your server address>
  2. If you don’t have, you can just follow the step 1&2 for github and do the above step.
  3. You can directly log in when next time you try to connect server with ssh <server>.

More details please see FOR GITHUB and SSH FOR UBUNTU.

This post is licensed under CC BY 4.0 by the author.

Elämäni Suomessa

Power BI practice for data visualization