Skip to content

Instantly share code, notes, and snippets.

@zmack
Created January 26, 2009 15:11
Show Gist options
  • Save zmack/52834 to your computer and use it in GitHub Desktop.
Save zmack/52834 to your computer and use it in GitHub Desktop.
#!/bin/sh
KEY="$HOME/.ssh/id_dsa.pub"
if [ ! -f $KEY ];then
echo "private key not found at $KEY"
echo "please create it with \"ssh-keygen -t dsa\""
exit
fi
if [ -z $1 ];then
echo "Usage: $0 username@host"
exit
fi
echo "Putting your key on $1... "
ssh -q $* "umask 0077; mkdir -p ~/.ssh ; echo "`cat $KEY`" >> ~/.ssh/authorized_keys"
echo "done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment