Add run.sh and insert -o option to ssh client invocation
This commit is contained in:
parent
f1251c68c1
commit
05a8aa9847
3 changed files with 9 additions and 4 deletions
|
@ -1,13 +1,13 @@
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
RUN mkdir -p /home/ubuntu/playground
|
|
||||||
COPY assets/* /home/ubuntu/playground/
|
|
||||||
|
|
||||||
RUN apt update && apt install openssh-server sudo -y
|
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 useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test
|
||||||
RUN echo 'test:test' | chpasswd
|
RUN echo 'test:test' | chpasswd
|
||||||
RUN service ssh start
|
RUN service ssh start
|
||||||
|
|
||||||
|
RUN mkdir -p /home/ubuntu/playground
|
||||||
|
COPY assets/ /home/ubuntu/playground/
|
||||||
|
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
|
|
||||||
# Start the OpenSSH server
|
# Start the OpenSSH server
|
||||||
|
|
5
run.sh
Executable file
5
run.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker compose down
|
||||||
|
docker compose up --build
|
||||||
|
|
2
ssh.sh
2
ssh.sh
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ssh-keygen -f "/home/pop-os/.ssh/known_hosts" -R "[localhost]:2222"
|
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
|
||||||
|
|
Loading…
Reference in a new issue