Regenerate SSH keys

This commit is contained in:
Héctor Molinero Fernández
2019-07-20 17:20:22 +02:00
parent 85da01153c
commit 17c73fe546
2 changed files with 14 additions and 6 deletions

View File

@@ -2,11 +2,6 @@
set -eu
# Disable xdummy if there is no graphics card
if [ "${DISABLE_GPU:?}" = 'true' ] || [ ! -d /dev/dri/ ]; then
unlink /etc/service/xdummy
fi
# Create unprivileged user and group
groupadd \
--gid "${UNPRIVILEGED_USER_GID:?}" \
@@ -38,12 +33,22 @@ unset UNPRIVILEGED_USER_PASSWORD
# Dump environment variables
export-env >> /etc/profile.d/env.sh
# Disable xdummy if there is no graphics card
if [ "${DISABLE_GPU:?}" = 'true' ] || [ ! -d /dev/dri/ ]; then
unlink /etc/service/xdummy
fi
# Create RANDFILE if it does not exist
RANDFILE=${RANDFILE-${HOME}/.rnd}
if [ ! -f "${RANDFILE}" ]; then
dd if=/dev/urandom of="${RANDFILE}" bs=256 count=1 >/dev/null 2>&1
fi
# Generate SSH keys if they do not exist
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server
fi
# Generate self-signed certificate
if [ ! -f "${RDP_TLS_KEY_PATH:?}" ] || [ ! -f "${RDP_TLS_CERT_PATH:?}" ]; then
KEY_FILE=${RDP_TLS_KEY_PATH:?}