#/bin/bash set -e set -x mkdir -p "$HOME/.ssh" for f in *.pub; do (printf %s "$(< ${f})"; echo); done >> "$HOME/.ssh/authorized_keys" cp "$HOME/.ssh/authorized_keys" "$HOME/.ssh/authorized_keys.bak" sort "$HOME/.ssh/authorized_keys" | uniq | tee "$HOME/.ssh/authorized_keys"