From 636d0da4192b77f71dc536579c5d23bdbb993a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 27 Apr 2024 23:31:43 +0200 Subject: [PATCH] armbian.sh: Make sure, passwordless login is disabled for root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- bin/ncp-check-version | 1 - bin/ncp-dist-upgrade.d/debian-11.sh | 1 + build/armbian/armbian.sh | 1 + ncp.sh | 3 ++- updates/1.54.0.sh | 7 +++++++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 updates/1.54.0.sh diff --git a/bin/ncp-check-version b/bin/ncp-check-version index 493062f51..dc499ad65 100755 --- a/bin/ncp-check-version +++ b/bin/ncp-check-version @@ -1,6 +1,5 @@ #!/bin/bash -set -x # update latest available version in /var/run/.ncp-latest-version TEMPDIR="$( mktemp -d /tmp/ncp-check.XXXXXX || ( echo "Failed to create temp dir. Exiting" >&2; exit 1 ) )" diff --git a/bin/ncp-dist-upgrade.d/debian-11.sh b/bin/ncp-dist-upgrade.d/debian-11.sh index c40a6bd1b..2b762ab24 100644 --- a/bin/ncp-dist-upgrade.d/debian-11.sh +++ b/bin/ncp-dist-upgrade.d/debian-11.sh @@ -56,6 +56,7 @@ then fi apt-get full-upgrade -y +apt-get install -y --no-install-recommends exfatprogs restore_maintenance_mode cfg="$(jq "." "$NCPCFG")" cfg="$(jq ".release = \"bookworm\"" <<<"$cfg")" diff --git a/build/armbian/armbian.sh b/build/armbian/armbian.sh index e49900aa7..985121062 100644 --- a/build/armbian/armbian.sh +++ b/build/armbian/armbian.sh @@ -43,6 +43,7 @@ systemctl disable ssh rm -f /etc/systemd/system/getty@.service.d/override.conf rm -f /etc/systemd/system/serial-getty@.service.d/override.conf rm -f /root/.not_logged_in_yet +sed -i 's|^root::|root:x:|' /etc/passwd basename "$IMG" | tee /usr/local/etc/ncp-baseimage diff --git a/ncp.sh b/ncp.sh index 9b110a143..489c9c161 100644 --- a/ncp.sh +++ b/ncp.sh @@ -246,7 +246,8 @@ EOF EOF echo ' -NCP is not activated yet. Please enter this instances local IP address in your webbrowser to complete activation.' >> /etc/issue +NCP is not activated yet. Please enter https://nextcloudpi.local or this instance'"'"'s local IP address in your webbrowser to complete activation. +' >> /etc/issue chmod a+x /etc/update-motd.d/* ## HOSTNAME AND mDNS diff --git a/updates/1.54.0.sh b/updates/1.54.0.sh new file mode 100644 index 000000000..e78cf2627 --- /dev/null +++ b/updates/1.54.0.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if getent passwd "$LOGNAME" | grep -e 'root' | grep -e '/usr/sbin/nologin' +then + chsh -s /bin/bash root + passwd -l root +fi \ No newline at end of file