Skip to content

Instantly share code, notes, and snippets.

@jpablobr
Created October 31, 2010 06:54
Show Gist options
  • Save jpablobr/656229 to your computer and use it in GitHub Desktop.
Save jpablobr/656229 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