From 6fbae80d2931651afebb87bb942bb4f4c671025e Mon Sep 17 00:00:00 2001 From: Emran Billah Date: Fri, 13 Sep 2024 16:59:24 -0300 Subject: [PATCH] ssh working ok, need to test with two separate computers when I have access to 2 ubuntu machines --- Dockerfile | 13 +++++++++++++ scripts/entrypoint.sh | 4 ++++ 2 files changed, 17 insertions(+) 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"