SSH.sh: Enable user when configuring SSH

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-10-03 22:33:26 +02:00
parent ddc04e6187
commit 9975742ff3
No known key found for this signature in database
GPG Key ID: 3510056072886A8F

View File

@ -15,7 +15,7 @@ is_active()
systemctl -q is-enabled ssh &>/dev/null
}
configure()
configure()
{
[[ $ACTIVE != "yes" ]] && {
systemctl stop ssh
@ -29,8 +29,8 @@ configure()
echo "Refusing to use the default Raspbian user and password. It's insecure"
return 1
}
[[ "$USER" == "root" ]] && [[ "$PASS" == "1234" ]] && {
echo "Refusing to use the default Armbian user and password. It's insecure"
[[ "$USER" == "root" ]] && {
echo "Refusing to use the root user for SSH. It's insecure"
return 1
}
@ -39,7 +39,7 @@ configure()
echo -e "$PASS\n$CONFIRM" | passwd "$USER" || return 1
# Reenable pi user
[[ "$USER" == "pi" ]] && usermod pi -s /bin/bash
usermod "$USER" -s /bin/bash
# Check for insecure default pi password ( taken from old jessie method )
# TODO Due to Debian bug #1003151 with mkpasswd this feature is not working properly at the moment - https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1837456.html