Skip to content

Commit

Permalink
extensions: ssh: insert only the last key of each user
Browse files Browse the repository at this point in the history
  • Loading branch information
maxux committed Sep 6, 2024
1 parent 5746f50 commit 9a06f04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/ssh/ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ rm -f "${ROOTDIR}/root/.ssh/authorized_keys"
if [ "${BUILDMODE}" == "debug" ]; then
for user in muhamadazmy delandtj maxux LeeSmet coesensbert; do
echo "[+] authorizing ssh key: ${user}"
wget https://github.com/${user}.keys -O- >> "${ROOTDIR}/root/.ssh/authorized_keys"

key=$(curl -s https://github.com/${user}.keys | tail -1)
echo "${key} ${user}@initramfs" >> "${ROOTDIR}/root/.ssh/authorized_keys"
done

chmod -f 600 "${ROOTDIR}/root/.ssh/authorized_keys"
Expand Down

0 comments on commit 9a06f04

Please sign in to comment.