From c5ca24176cd21174fd79dd89859e3408f9d43a4c Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Mon, 28 Nov 2022 11:33:49 +0100 Subject: [PATCH] Override sudoers with configuration that allows root and the sudo group to run any command. (#8) Members of the sudo do not have to specify a password. --- docker/DockerFile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/DockerFile b/docker/DockerFile index 65221db..7bdec7f 100644 --- a/docker/DockerFile +++ b/docker/DockerFile @@ -17,7 +17,10 @@ RUN apk add --no-cache syslog-ng && \ # install and configure sudo apk add --no-cache sudo && \ addgroup sudo && \ - sed -i 's/#\s*%sudo\s*ALL=(ALL)\s*ALL/%sudo ALL=(ALL) NOPASSWD:ALL/' /etc/sudoers && \ + # allow root to run any command + echo 'root ALL=(ALL) ALL' > /etc/sudoers && \ + # allow everyone in the 'sudo' group to run any command without a password + echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ # add user to run most of the integration tests adduser -D sshnet && \ passwd -u sshnet && \