Skip to content

Instantly share code, notes, and snippets.

@frnz
Forked from jpablobr/ssh_key.sh
Created October 31, 2010 08:49
Show Gist options
  • Save frnz/656314 to your computer and use it in GitHub Desktop.
Save frnz/656314 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