Skip to content

Commit

Permalink
feat: put ssh user into distcc system group
Browse files Browse the repository at this point in the history
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 <henning@hennsch.de>
  • Loading branch information
henning-schild committed Sep 30, 2024
1 parent 9cf4dcf commit 64f1286
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker-entrypoint-ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 64f1286

Please sign in to comment.