fix not applied sudo password hash value

This commit is contained in:
leey0818 2022-10-20 00:19:34 +09:00
parent 2d0ebfad3b
commit 3b78eb20ef
2 changed files with 2 additions and 1 deletions

View File

@ -75,6 +75,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "20.10.22:", desc: "Fix not applied env var `SUDO_PASSWORD_HASH`." }
- { date: "05.10.22:", desc: "Install recommended deps to maintain parity with the older images." }
- { date: "29.09.22:", desc: "Rebase to jammy, switch to s6v3. Fix chown logic to skip `/config/workspace` contents." }
- { date: "20.02.22:", desc: "Install using the official tarballs." }

View File

@ -10,7 +10,7 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
fi
if [ -n "${SUDO_PASSWORD_HASH}" ]; then
echo "setting sudo password using sudo password hash"
sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow
echo -e "abc:${SUDO_PASSWORD_HASH}" | chpasswd -e
else
echo "setting sudo password using SUDO_PASSWORD env var"
echo -e "${SUDO_PASSWORD}\n${SUDO_PASSWORD}" | passwd abc