Browse Source

Add all pub files to the authorized_keys

master
Drew Short 5 years ago
parent
commit
9baf5ae743
  1. 9
      insert_authorized_keys.sh

9
insert_authorized_keys.sh

@ -0,0 +1,9 @@
#/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"
Loading…
Cancel
Save