You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
276 B

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