diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-06-27 18:46:18 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-06-27 18:58:15 +0300 |
commit | 2aa0e8f0d48d0c6cae0989bfbff717c21c48e199 (patch) | |
tree | 50176275644f2706047728f3b54d64e0c65d82e7 | |
parent | 8d0faf748fe13692bce26fd4833b707c4f5e0d59 (diff) |
SSH: fix root password in Raspbianv0.57.16
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | etc/ncp-config.d/SSH.sh | 32 |
2 files changed, 21 insertions, 15 deletions
diff --git a/changelog.md b/changelog.md index 3fb06e63..c3057a0a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v0.57.15](https://github.com/nextcloud/nextcloudpi/commit/164b5cd) (2018-06-26) nc-automount: fix udiskie not installed in latest image +[v0.57.16](https://github.com/nextcloud/nextcloudpi/commit/cf3dbf8) (2018-06-27) SSH: fix root password in Raspbian + +[v0.57.15](https://github.com/nextcloud/nextcloudpi/commit/c329280) (2018-06-26) nc-automount: fix udiskie not installed in latest image [v0.57.14](https://github.com/nextcloud/nextcloudpi/commit/16af06f) (2018-06-26) added database dir to ncp-info (#553) diff --git a/etc/ncp-config.d/SSH.sh b/etc/ncp-config.d/SSH.sh index cbf72263..0693753f 100644 --- a/etc/ncp-config.d/SSH.sh +++ b/etc/ncp-config.d/SSH.sh @@ -53,14 +53,16 @@ configure() local SHADOW="$( grep -E '^pi:' /etc/shadow )" test -n "${SHADOW}" && { local SALT=$(echo "${SHADOW}" | sed -n 's/pi:\$6\$//;s/\$.*//p') - local HASH=$(mkpasswd -msha-512 raspberry "$SALT") - grep -q "${HASH}" <<< "${SHADOW}" && { - systemctl stop ssh - systemctl disable ssh - echo "The user pi is using the default password. Refusing to activate SSH" - echo "SSH disabled" - return 1 + [[ "${SALT}" != "" ]] && { + local HASH=$(mkpasswd -msha-512 raspberry "$SALT") + grep -q "${HASH}" <<< "${SHADOW}" && { + systemctl stop ssh + systemctl disable ssh + echo "The user pi is using the default password. Refusing to activate SSH" + echo "SSH disabled" + return 1 + } } } @@ -68,14 +70,16 @@ configure() local SHADOW="$( grep -E '^root:' /etc/shadow )" test -n "${SHADOW}" && { local SALT=$(echo "${SHADOW}" | sed -n 's/root:\$6\$//;s/\$.*//p') - local HASH=$(mkpasswd -msha-512 1234 "$SALT") - grep -q "${HASH}" <<< "${SHADOW}" && { - systemctl stop ssh - systemctl disable ssh - echo "The user root is using the default password. Refusing to activate SSH" - echo "SSH disabled" - return 1 + [[ "${SALT}" != "" ]] && { + local HASH=$(mkpasswd -msha-512 1234 "$SALT") + grep -q "${HASH}" <<< "${SHADOW}" && { + systemctl stop ssh + systemctl disable ssh + echo "The user root is using the default password. Refusing to activate SSH" + echo "SSH disabled" + return 1 + } } } |