Skip to content

@joshbetz /.zshrc
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A version of ssh-copy-id for the .bashrc file on your Mac.
ssh-copy-id() {
USER=$(whoami)
USAGE="Usage: `basename $0` [-i FILE] user@host"
FILE="$HOME/.ssh/id_rsa.pub"
if [ $# -lt 1 ]; then
echo "$USAGE"
fi
while getopts “i::” OPTION; do
case $OPTION in
i)
FILE=$OPTARG
;;
?)
echo "$USAGE"
;;
esac
done
shift $OPTIND-1
cat $FILE | ssh $1 "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
}
@vjanelle

Might want to use $HOME instead of /Users/$USER, that'll be more portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.