# Use the official Ubuntu 22.04 as the base image FROM ubuntu:22.04 # Update the package list and install sudo RUN apt-get update \ && apt-get install -y sudo # Ensure sudo has the correct permissions RUN chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo # Create a new user 'compsec' and add it to the sudo group RUN adduser --disabled-password --gecos '' compsec RUN echo "compsec:compsec" | chpasswd RUN adduser compsec sudo RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # Switch to the 'compsec' user and set the working directory USER compsec WORKDIR /home/compsec ARG DEBIAN_FRONTEND=noninteractive # Add 32-bit architecture support RUN sudo dpkg --add-architecture i386 # Update apt sources to use the Daum Kakao mirror RUN sudo sed -i 's/archive.ubuntu.com/ftp.daumkakao.com/g' /etc/apt/sources.list RUN sudo sed -i 's/security.ubuntu.com/ftp.daumkakao.com/g' /etc/apt/sources.list # Update and upgrade the system, and install necessary packages RUN sudo apt-get update && sudo apt-get upgrade -y RUN sudo apt-get install openssh-server -y RUN sudo apt-get install build-essential gcc g++ vim git -y RUN sudo apt-get install libtool automake bison libglib2.0-dev -y RUN sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 -y RUN sudo apt-get install gdb -y RUN sudo apt-get install gcc flex bison libncurses-dev libelf-dev libssl-dev qemu -y RUN sudo apt-get install python-is-python3 git libssl-dev libffi-dev build-essential libcapstone-dev -y RUN sudo apt-get install net-tools curl netcat -y # Enable password authentication in SSH RUN sudo sed -i 's/#PasswordAuthentication/PasswordAuthentication/' /etc/ssh/sshd_config RUN sudo mkdir /run/sshd # Start the SSH server CMD ["sudo", "/usr/sbin/sshd", "-D"]