From 8571b7380fedeb1671b185ab1886a490f4897adf Mon Sep 17 00:00:00 2001 From: Hans Thienpondt Date: Fri, 29 Aug 2025 10:36:17 +0000 Subject: [PATCH] Change the username user to admin: s/user/admin/g --- Dockerfile | 18 +++++++++--------- README.md | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1165f08..a8beeed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,19 +50,19 @@ RUN rm /etc/motd ### # set a password to SSH into the docker container with -RUN adduser -D -h /home/user -s /bin/bash user -RUN adduser user wheel +RUN adduser -D -h /home/admin -s /bin/bash admin +RUN adduser admin wheel RUN sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers -RUN echo 'user:multit00l' | chpasswd -# copy a basic but nicer than standard bashrc for the user -COPY .bashrc /home/user/.bashrc -RUN chown user:user /home/user/.bashrc +RUN echo 'admin:multit00l' | chpasswd +# copy a basic but nicer than standard bashrc for the user 'admin' +COPY .bashrc /home/admin/.bashrc +RUN chown admin:admin /home/admin/.bashrc # Ensure .bashrc is sourced by creating a .bash_profile that sources .bashrc -RUN echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > /home/user/.bash_profile +RUN echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > /home/admin/.bash_profile # Ensure configs in /etc/ssh/ssh_config.d/ are included RUN echo "Include /etc/ssh/ssh_config.d/*" >> /etc/ssh/ssh_config -# Change ownership of the home directory to the user -RUN chown -R user:user /home/user +# Change ownership of the home directory to the user 'admin' +RUN chown -R admin:admin /home/admin ### COPY index.html /usr/share/nginx/html/ diff --git a/README.md b/README.md index 8182644..2464ce2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ This container image is often used in containerlabs to emulate a client. The ima To connect to this image users can use -* `ssh user@`. Password `multit00l`. +* `ssh admin@`. Password `multit00l`. * or `docker exec -i -t bash`