Skip to content

Instantly share code, notes, and snippets.

@shiveshabhishek
Last active April 26, 2020 09:13
Show Gist options
  • Save shiveshabhishek/4417f3914e83bdd96d608714dc703158 to your computer and use it in GitHub Desktop.
Save shiveshabhishek/4417f3914e83bdd96d608714dc703158 to your computer and use it in GitHub Desktop.
Passwordless ssh via keygen

Set passwordless SSH from A to B:

  • Run ssh-keygen into the machine you want to ssh from(A)
  • cd into ~/.ssh
  • make a directory if not exist in the machine you want to ssh to(B) --> mkdir ~/.ssh/
  • cp id_rsa.pub USER@IP_OF_B:~/.ssh/authorized_keys The above line will copy id_rsa.pub, into the machine you want to ssh to(B), in the directory ~/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment