Skip to content

Instantly share code, notes, and snippets.

@vpipkt
Created August 25, 2016 17:48
Show Gist options
  • Save vpipkt/7a339e33e2fa63280b5c7b806a217e2d to your computer and use it in GitHub Desktop.
Save vpipkt/7a339e33e2fa63280b5c7b806a217e2d to your computer and use it in GitHub Desktop.
Password less ssh

From a host homeplate Targeting a host secondbase

Assumes you've already got a public key on homeplate. If not:

you@homeplate $ ssh-keygen -t rsa
```

Make sure there's an `~/.ssh` directory on `secondbase`:

    you@homeplate $ ssh you@secondbase mkdir -p .ssh

Then append your `homeplace`'s `id_rsa.pub` into `secondbase` authorized keys.

    you@homeplate $ cat ~/.ssh/id_rsa.pub | ssh you@secondbase 'cat >> ~/.ssh/authorized_keys'
   
Make sure permissions are ok.

    you@homeplate $ ssh you@secondbase "chmod 700 ~/.ssh; chmod 640 ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment