From a566dc91b24c2cc9c70af9e9f82894d00ba82823 Mon Sep 17 00:00:00 2001 From: procount Date: Sat, 11 Feb 2023 01:05:48 +0000 Subject: [PATCH] Fixed secure ssh --- buildroot/package/dropbear/dropbear.mk | 2 ++ buildroot/package/recovery/init | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/buildroot/package/dropbear/dropbear.mk b/buildroot/package/dropbear/dropbear.mk index 9e8776ce3..a788f0a55 100644 --- a/buildroot/package/dropbear/dropbear.mk +++ b/buildroot/package/dropbear/dropbear.mk @@ -56,6 +56,8 @@ ifeq ($(BR2_USE_MMU),y) define DROPBEAR_INSTALL_INIT_SYSV $(INSTALL) -D -m 755 package/dropbear/S50dropbear \ $(TARGET_DIR)/etc/init.d/S50dropbear + $(INSTALL) -D -m 755 package/dropbear/S50dropbear \ + $(TARGET_DIR)/etc/S50dropbear endef else DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE diff --git a/buildroot/package/recovery/init b/buildroot/package/recovery/init index bb25cc6a5..bca51896a 100755 --- a/buildroot/package/recovery/init +++ b/buildroot/package/recovery/init @@ -79,13 +79,6 @@ if grep -q vncshare /proc/cmdline; then export QWS_DISPLAY="VNC:"$QWS_DISPLAY fi -if grep -q ssh /proc/cmdline; then - # SSH server mode. Mainly useful for debugging - /bin/mkdir -p /dev/pts - /bin/mount -t devpts devpts /dev/pts - . /etc/S50dropbear start & -fi - # Mouse acceleration @@ -159,6 +152,19 @@ if ( [ ${SAFE_MODE#*=} -eq 1 ] && ! grep -q disablesafemode /proc/cmdline ) || g sh fi +if grep -q ssh /proc/cmdline; then + # SSH server mode. Mainly useful for debugging + /bin/mkdir -p /dev/pts + /bin/mount -t devpts devpts /dev/pts + + #This dev needs to be dynamic for USB boot. Replace last partition '1' of pinndriver with '5' + /bin/mount ${pinndrive%?}5 /settings + sleep 1 + . /etc/S50dropbear start & + sleep 1 + /bin/umount /settings +fi + RUN_INSTALLER= GPIO_TRIGGER= KEYBOARD_NO_TRIGGER=