diff --git a/Dockerfile b/Dockerfile index 8e38399..a65391a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,21 @@ RUN apt-get update && apt-get install -y \ util-linux \ bsdmainutils \ vim \ + openssh-server \ && rm -rf /var/lib/apt/lists/* +# Create necessary directories for SSH +RUN mkdir /var/run/sshd + +# Create the user 'spiri' and set passwords for both 'root' and 'spiri' +RUN useradd -m spiri && \ + echo 'root:spiri-friend' | chpasswd && \ + echo 'spiri:spiri-friend' | chpasswd && \ + sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config + +# Expose SSH port +EXPOSE 22 + # Clone the xbnet repository RUN git clone https://github.com/jgoerzen/xbnet.git /usr/src/xbnet diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index a91b923..5c91265 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -16,6 +16,10 @@ echo "Starting entrypoint.sh" echo "Setting associated environment variables. Calling /set-env-vars.sh" source /set-env-vars.sh +# Start SSH in the background +echo "Starting SSH service..." +/usr/sbin/sshd + # Main loop loop() { echo "Starting loop"