Skip to content

Instantly share code, notes, and snippets.

@jamessom
Last active February 4, 2020 16:34
Show Gist options
  • Select an option

  • Save jamessom/d3da33e12cf78e01508197ad86e996f3 to your computer and use it in GitHub Desktop.

Select an option

Save jamessom/d3da33e12cf78e01508197ad86e996f3 to your computer and use it in GitHub Desktop.
Generate authorizad_keys

You have to create the .ssh directory and the authorized_keys file the first time.

Create the .ssh directory:

mkdir ~/.ssh

Set the right permissions:

chmod 700 ~/.ssh

Create the authorized_keys file:

touch ~/.ssh/authorized_keys

Set the right permissions:

chmod 600 ~/.ssh/authorized_keys

The permissions are important! It won't work without the right permissions!

Now you can add the public key to the authorized_keys file:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

You have to add the public key of your computer to the authorized_keys file of the computer you want to access using SSH Keys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment