mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
armbian.sh: Disable autologin, require root password and use passwd -l instead of nologin shell for root login prevention
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
a0c6b213e6
commit
78039d38d1
@ -39,6 +39,12 @@ run_app_unsafe post-inst.sh
|
||||
# disable SSH by default, it can be enabled through ncp-web
|
||||
systemctl disable ssh
|
||||
|
||||
# disable armbian autologin
|
||||
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
|
||||
|
||||
cd -
|
||||
|
||||
2
ncp.sh
2
ncp.sh
@ -82,7 +82,7 @@ EOF
|
||||
echo -e "$WEBPASSWD\n$WEBPASSWD" | passwd "$WEBADMIN"
|
||||
is_docker || is_lxc || {
|
||||
chsh -s /usr/sbin/nologin "$WEBADMIN"
|
||||
chsh -s /usr/sbin/nologin root
|
||||
passwd -l root
|
||||
}
|
||||
|
||||
## NCP LAUNCHER
|
||||
|
||||
10
updates/1.54.0.sh
Normal file
10
updates/1.54.0.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/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
|
||||
|
||||
apt-get update
|
||||
apt-get install --no-install-recommends -y tmux
|
||||
Loading…
x
Reference in New Issue
Block a user