From f32742dd502b0d07062e08bb2df3a32875980bbf Mon Sep 17 00:00:00 2001 From: cheezedoodle2 Date: Tue, 6 Jun 2023 12:20:41 -0700 Subject: [PATCH] Turn off password authentication in the container, add run script --- docker/dev/Dockerfile | 3 ++- docker/dev/run.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docker/dev/run.sh diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 89e0eee..b9a56c1 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -4,7 +4,8 @@ RUN apt install -y openssh-server RUN mkdir /var/run/sshd RUN echo 'root:password' | chpasswd RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config -RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config +RUN sed -i 's/#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/' /etc/ssh/sshd_config ADD authorized_keys /root/.ssh/authorized_keys RUN chmod 600 /root/.ssh/authorized_keys EXPOSE 22 diff --git a/docker/dev/run.sh b/docker/dev/run.sh new file mode 100644 index 0000000..2096765 --- /dev/null +++ b/docker/dev/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run -p 2222:22 -d dev