# HG changeset patch # User Jeff Hammel # Date 1438789463 25200 # Node ID 12f0be02e9cca31a2a7247e9bb78150040ece795 # Parent 14eee92008547399e326a9de6450000aacdfc67e http://www.howtogeek.com/168147/add-public-ssh-key-to-remote-server-in-a-single-command/ diff -r 14eee9200854 -r 12f0be02e9cc bin/add_ssh_key.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/add_ssh_key.sh Wed Aug 05 08:44:23 2015 -0700 @@ -0,0 +1,10 @@ +#!/bin/bash -x + +# see http://www.howtogeek.com/168147/add-public-ssh-key-to-remote-server-in-a-single-command/ + +KEY=~/.ssh/id_rsa.pub + +for arg in $@ +do + cat "${KEY}" | ssh ${arg} 'cat >> .ssh/authorized_keys' +done