Skip to content

Instantly share code, notes, and snippets.

@istro
Last active December 25, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save istro/6891815 to your computer and use it in GitHub Desktop.
Save istro/6891815 to your computer and use it in GitHub Desktop.
RSA authorization setup instructions

Generate a key pair:

ssh-keygen -t rsa

Press enter when it prompts for file location Enter a passphrase (simple one will do - it's only ever important if your private key (the one on your machine) gets compromised)

This will create a .ssh/ folder with two files - id_rsa and id_rsa.pub in your home directory.

Copy your public key to the server,

and move it into .ssh directory as "authorized_keys" file (given you don't have ssh keys on the server already - if you do, you probably know how to just add the new key to the existing authorized_keys file):

ssh username@hostname.org mkdir .ssh;
scp ~/.ssh/id_rsa.pub username@hostname.org:~/.ssh/authorized_keys

update permissions (on the server):

ssh username@hostname.org if you entered a passphrase for rsa keys, it will be prompted now chmod 700 .ssh; chmod 640 .ssh/authorized_keys

Now you're all set.

Connect to the server as usual. You should be logged in directly.

Profit.

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