docker-sshd/entrypoint.sh
Dennis Hermsmeier 279065bbec
quote root env
2018-05-22 08:35:14 +02:00

13 lines
334 B
Bash
Executable File

#!/bin/sh
# generate host keys if not present
ssh-keygen -A
# check wether a random root-password is provided
if [ ! -z "${ROOT_PASSWORD}" ] && [ "${ROOT_PASSWORD}" != "root" ]; then
echo "root:${ROOT_PASSWORD}" | chpasswd
fi
# do not detach (-D), log to stderr (-e), passthrough other arguments
exec /usr/sbin/sshd -D -e "$@"