Skip to content

Instantly share code, notes, and snippets.

@samg
Created January 19, 2010 22:20
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 samg/281368 to your computer and use it in GitHub Desktop.
Save samg/281368 to your computer and use it in GitHub Desktop.
#!/bin/bash
scp ~/.ssh/id_rsa.pub $1:~
ssh $1 "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod -R 600 ~/.ssh/* && cat ~/id_rsa.pub >> ~/.ssh/authorized_keys && rm ~/id_rsa.pub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment