Skip to content

Instantly share code, notes, and snippets.

View lebowitz's full-sized avatar

Craig Lebowitz lebowitz

  • Bonterra
  • Washington, DC
View GitHub Profile
#!/bin/sh
USERNAME="cal"
if test -z $1
then
echo "you must specify a hostname or ip address as the first argument"
exit 1
fi
key=`cat ~/.ssh/id_dsa.pub`
ssh $USERNAME@$1 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo \"$key\" >> ~/.ssh/authorized_keys && chmod 644 ~/.ssh/authorized_keys"
if [ $? = "0" ]; then