unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

tinyssh-run (498B)


      1 #!/bin/sh
      2 # tinyssh run: provision host keys once, then serve ssh via tcpsvd.
      3 # tinysshd-makekey is NOT idempotent (mkdir fails when the keydir exists,
      4 # and rerunning would rotate keys), so the ed25519.pk guard below is
      5 # load-bearing - never exec makekey unconditionally.
      6 exec 2>&1
      7 KEYDIR=/etc/tinyssh/sshkeydir
      8 mkdir -p /etc/tinyssh
      9 if [ ! -e "${KEYDIR}/ed25519.pk" ]; then
     10   /usr/sbin/tinysshd-makekey -q "${KEYDIR}" || exit 1
     11 fi
     12 exec /usr/bin/tcpsvd -vE 0 22 /usr/sbin/tinysshd -v "${KEYDIR}"