From 05a8aa984716e7a082581403cfa649964d76e9ef Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Thu, 16 Feb 2023 08:51:46 +0100 Subject: [PATCH] Add run.sh and insert -o option to ssh client invocation --- Dockerfile | 6 +++--- run.sh | 5 +++++ ssh.sh | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile index edb8e0c..5e15cec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ FROM ubuntu -RUN mkdir -p /home/ubuntu/playground -COPY assets/* /home/ubuntu/playground/ - RUN apt update && apt install openssh-server sudo -y RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test RUN echo 'test:test' | chpasswd RUN service ssh start +RUN mkdir -p /home/ubuntu/playground +COPY assets/ /home/ubuntu/playground/ + EXPOSE 22 # Start the OpenSSH server diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..16901f7 --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +docker compose down +docker compose up --build + diff --git a/ssh.sh b/ssh.sh index ff27301..b7c62bb 100755 --- a/ssh.sh +++ b/ssh.sh @@ -1,3 +1,3 @@ #!/bin/bash ssh-keygen -f "/home/pop-os/.ssh/known_hosts" -R "[localhost]:2222" -ssh -p 2222 test@localhost +ssh -p 2222 -o StrictHostKeyChecking=accept-new test@localhost