Skip to content

Instantly share code, notes, and snippets.

@igorescobar
Created April 24, 2013 13:28
Show Gist options
  • Select an option

  • Save igorescobar/5452120 to your computer and use it in GitHub Desktop.

Select an option

Save igorescobar/5452120 to your computer and use it in GitHub Desktop.
Alias to add your ~/.id_rsa.pub to ~/.ssh/authorized_keys on a remote server.
# ssh-copy-id user@host
alias ssh-copy-id='_(){ ssh $1 -p 5022 "mkdir -m 700 ~/.ssh; echo " $(< ~/.ssh/id_rsa.pub) " >> ~/.ssh/authorized_keys ; chmod 600 ~/.ssh/authorized_keys"; }; _'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment