Skip to content

Commit c5ca241

Browse files
authored
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.
1 parent a31325e commit c5ca241

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docker/DockerFile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ RUN apk add --no-cache syslog-ng && \
1717
# install and configure sudo
1818
apk add --no-cache sudo && \
1919
addgroup sudo && \
20-
sed -i 's/#\s*%sudo\s*ALL=(ALL)\s*ALL/%sudo ALL=(ALL) NOPASSWD:ALL/' /etc/sudoers && \
20+
# allow root to run any command
21+
echo 'root ALL=(ALL) ALL' > /etc/sudoers && \
22+
# allow everyone in the 'sudo' group to run any command without a password
23+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
2124
# add user to run most of the integration tests
2225
adduser -D sshnet && \
2326
passwd -u sshnet && \

0 commit comments

Comments
 (0)