Skip to content

Commit

Permalink
Update setup-sshd.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <zoey@z0ey.de>
  • Loading branch information
Zoey2936 authored Mar 24, 2024
1 parent 1562d40 commit be234c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions setup-sshd.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/sh

if ! echo "$SSH_PUBKEY" | grep -q "^ssh-.*$"; then
echo "SSH_PUBKEY needs to start with ssh-."
sleep inf
fi

ssh-keygen -A
mkdir -vp /tmp/.ssh
echo "$SSH_PUBKEY" | tee -a /tmp/.ssh/authorized_keys

exec /usr/sbin/sshd -De

0 comments on commit be234c8

Please sign in to comment.