Passwordless sudo for admin

This commit is contained in:
dave 2018-10-31 09:26:45 -07:00
parent 02a006040a
commit 8d8e2207fe
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ RUN useradd --create-home --groups sudo admin && \
rm -rf /etc/ssh/*_key* && \
mkdir /etc/ssh/keys && \
sed -i -E 's/#?\s?HostKey \/etc\/ssh\//HostKey \/etc\/ssh\/keys\//' /etc/ssh/sshd_config && \
su -c "mkdir ~/.ssh" admin
su -c "mkdir ~/.ssh" admin && \
echo 'admin ALL=(ALL) NOPASSWD:ALL' | tee /etc/sudoers.d/admin
COPY authorized_keys /home/admin/.ssh/authorized_keys