From 2935b771cb80128ede4b47399a70ea4e1cdd8a2c Mon Sep 17 00:00:00 2001 From: Ludovic Poujol Date: Thu, 28 Feb 2019 16:19:54 +0100 Subject: [PATCH] Fix #19 - Do not enforce md5 for password --- scripts/web-add-nginx.sh | 2 +- scripts/web-add.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/web-add-nginx.sh b/scripts/web-add-nginx.sh index 9ce3197..21e1972 100755 --- a/scripts/web-add-nginx.sh +++ b/scripts/web-add-nginx.sh @@ -199,7 +199,7 @@ create_www_account() { /usr/sbin/adduser --gecos "User $in_login" --disabled-password "$in_login" \ --shell /bin/bash $OPT_UID $OPT_UID_ARG --force-badname \ --home "$HOME_DIR_USER" >/dev/null - [ -z "$in_sshkey" ] && echo "$in_login:$in_passwd" | chpasswd --md5 + [ -z "$in_sshkey" ] && echo "$in_login:$in_passwd" | chpasswd [ -z "$in_sshkey" ] || [ -n "$HOME_DIR_USER" ] \ && mkdir "$HOME_DIR_USER/.ssh" \ && echo "$in_sshkey" > "$HOME_DIR_USER/.ssh/authorized_keys" \ diff --git a/scripts/web-add.sh b/scripts/web-add.sh index 5c0e93a..161144b 100755 --- a/scripts/web-add.sh +++ b/scripts/web-add.sh @@ -263,8 +263,8 @@ create_www_account() { --home "$HOME_DIR_USER" >/dev/null [ -z "$in_sshkey" ] \ - && echo "$in_login:$in_passwd" | chpasswd --md5 - + && echo "$in_login:$in_passwd" | chpasswd + [ -z "$in_sshkey" ] \ || [ -n "$HOME_DIR_USER" ] \ && mkdir "$HOME_DIR_USER/.ssh" \ @@ -300,7 +300,7 @@ create_www_account() { for php_version in "${PHP_VERSIONS[@]}"; do lxc-attach -n php"${php_version}" -- /usr/sbin/addgroup "$in_login" --gid "$gid" --force-badname >/dev/null lxc-attach -n php"${php_version}" -- /usr/sbin/adduser --gecos "User $in_login" --disabled-password "$in_login" --shell /bin/bash --uid "$uid" --gid "$gid" --force-badname --home "$HOME_DIR_USER" >/dev/null - lxc-attach -n php"${php_version}" -- [ -z "$in_sshkey" ] && echo "$in_login:$in_passwd" | chpasswd --md5 + lxc-attach -n php"${php_version}" -- [ -z "$in_sshkey" ] && echo "$in_login:$in_passwd" | chpasswd lxc-attach -n php"${php_version}" -- /usr/sbin/adduser --disabled-password --home "$HOME_DIR_USER"/www --no-create-home --shell /bin/false --gecos "WWW $in_login" www-"$in_login" --uid "$www_uid" --ingroup "$in_login" --force-badname >/dev/null done