tinyssh icon indicating copy to clipboard operation
tinyssh copied to clipboard

tinyssh-initramfs scripts for debian users

Open blob42 opened this issue 6 years ago • 4 comments

Hi,

I looked for an equivalent to mkinitcpio-tinyssh for debian and could not find it anywhere.
I made a quick one using initramfs-tools based on the already existing dropbear hooks and the Arch one.

Sharing it here for future users, feel free to include it in your repo if you wish.

https://git.sp4ke.com/sp4ke/tinyssh-initramfs

blob42 avatar Apr 20 '19 21:04 blob42

do you also have an /etc/init.d/tinysshd by chance?

alexmyczko avatar Mar 23 '21 08:03 alexmyczko

I'm not sure what you need buy on the main system I'm using a systemd socket+service

blob42 avatar Mar 24 '21 14:03 blob42

there's no systemd for debian gnu/kfreebsd.

alexmyczko avatar Mar 24 '21 14:03 alexmyczko

@alexmyczko you might use this one (requires busybox)

#!/bin/sh
# ***********
if [ ! -e /etc/tinyssh/ed25519.pk ]; then
  mkdir /etc/tinysshd
  tinysshd-makekey /etc/tinysshd
fi
#
case "$1" in
  start)
    echo -n "starting tiny-sshd ... "
    /bin/busybox start-stop-daemon -p /var/run/tinysshd.pid -m -S /bin/busybox -- tcpsvd 0 22 /usr/sbin/tinysshd -v /etc/tinysshd &
    while [ ! -e /var/run/tinysshd.pid ]; do
      echo -n '!'
      sleep 1
    done
    echo '!'
    ;;
  stop)
    echo "stopping tiny-sshd ..."
    /bin/busybox start-stop-daemon -p /var/run/tinysshd.pid -s KILL -K
    ;;
  *) exit 1
    ;;
esac
#

terefang avatar Oct 07 '21 09:10 terefang