From 0a108c460debbdf9dd05a6a4c7c6088e689c9425 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 18 Aug 2025 01:18:55 +0200 Subject: [PATCH] . --- post-install.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/post-install.sh b/post-install.sh index 3667e18..ef9c0cc 100755 --- a/post-install.sh +++ b/post-install.sh @@ -207,14 +207,14 @@ depends() { } install() { - inst_multiple tinysshd tinyssh-keyconvert ssh-keygen + inst_multiple tinysshd tinysshd-makekey mkdir -p "$initdir/etc/tinyssh" # Copy authorized keys [ -f /etc/tinyssh/authorized_keys ] && inst /etc/tinyssh/authorized_keys /etc/tinyssh/authorized_keys # Copy host keys - inst /etc/tinyssh/sshkeydir /etc/tinyssh/ 2>/dev/null || true + [ -d /etc/tinyssh/sshkeydir ] && inst /etc/tinyssh/sshkeydir /etc/tinyssh/ 2>/dev/null || true # Install startup script inst_hook cmdline 60 "$moddir/tinyssh-start.sh" @@ -229,13 +229,7 @@ cat > /usr/lib/dracut/modules.d/60tinyssh/tinyssh-start.sh << 'EOF' #!/bin/bash info "Starting tinyssh SSH server on port 2222..." [ -d /etc/tinyssh ] || mkdir -p /etc/tinyssh -[ -d /etc/tinyssh/sshkeydir ] || { - mkdir -p /etc/tinyssh/sshkeydir - ssh-keygen -A - for key in /etc/ssh/ssh_host_*_key; do - [ -f "$key" ] && tinyssh-keyconvert "$key" /etc/tinyssh/sshkeydir/ - done -} +[ -d /etc/tinyssh/sshkeydir ] || tinysshd-makekey /etc/tinyssh/sshkeydir tinysshd -p 2222 /etc/tinyssh/sshkeydir & EOF @@ -252,7 +246,7 @@ EOF chmod +x /usr/lib/dracut/modules.d/60tinyssh/*.sh # Setup tinyssh -mkdir -p /etc/tinyssh/sshkeydir +mkdir -p /etc/tinyssh echo "${SSH_KEY}" > /etc/tinyssh/authorized_keys chmod 600 /etc/tinyssh/authorized_keys