Skip to content

Instantly share code, notes, and snippets.

@innyso
Last active May 9, 2020 11:52
Show Gist options
  • Save innyso/b419d397a9f67c67f73c to your computer and use it in GitHub Desktop.
Save innyso/b419d397a9f67c67f73c to your computer and use it in GitHub Desktop.
#ssh #setup #config

This is something that I do all the time but I always get it wrong....

  • Navigate to ~/.ssh/

  • Run below command and follow the prompt

ssh-keygen -t rsa
  • Make sure the permission are as follow
    • .ssh directory is 700 (drwx------)
    • public key is 644 (-rw-r--r--)
    • private key is 600 (-rw-------)

NOTE: if you are using git-bash on windows and chmod doesnt work, then read this and install cygwin to chmod

NOTE NOTE: Host * should always be the last entry as a catchall

  • Create config file in ~/.ssh/ . A sample config should look something like this:
Host *
  User user123
  IdentityFile ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment