From 64f12865d863836ad46530d112c957c9795f25aa Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Wed, 25 Sep 2024 15:46:29 +0200 Subject: [PATCH] feat: put ssh user into distcc system group Instead of creating a new group put the user in the existing group. The tcp version of the container will be running as distcc:distcc, using the same group will allow sharing directories rw. This patch prepares for the introduction of a persistent cache. Related-to: #64 Signed-off-by: Henning Schild --- docker-entrypoint-ssh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint-ssh.sh b/docker-entrypoint-ssh.sh index 3031b1e..785e573 100755 --- a/docker-entrypoint-ssh.sh +++ b/docker-entrypoint-ssh.sh @@ -11,12 +11,12 @@ fi if [ "$1" = "sshd" ]; then # Create user and set up SSH access - id "${SSH_USERNAME}" >/dev/null 2>&1 || useradd "${SSH_USERNAME}" + id "${SSH_USERNAME}" >/dev/null 2>&1 || useradd -g distcc "${SSH_USERNAME}" mkdir -p "/home/${SSH_USERNAME}/.ssh" - chown "${SSH_USERNAME}:${SSH_USERNAME}" "/home/${SSH_USERNAME}/.ssh" + chown "${SSH_USERNAME}:distcc" "/home/${SSH_USERNAME}/.ssh" chmod 700 "/home/${SSH_USERNAME}/.ssh" echo "${AUTHORIZED_KEYS}" > "/home/${SSH_USERNAME}/.ssh/authorized_keys" - chown "${SSH_USERNAME}:${SSH_USERNAME}" "/home/${SSH_USERNAME}/.ssh/authorized_keys" + chown "${SSH_USERNAME}:distcc" "/home/${SSH_USERNAME}/.ssh/authorized_keys" chmod 600 "/home/${SSH_USERNAME}/.ssh/authorized_keys" # Create missing SSH host keys ssh-keygen -A