From 4bacfdc51a35d967326160ee667ff84d6f5f4ca6 Mon Sep 17 00:00:00 2001 From: David Pinheiro Date: Wed, 2 Oct 2019 21:48:12 -0700 Subject: [PATCH] Fix ssh server logs on test env. container --- test-env/README.md | 6 ++++++ test-env/ssh-server/Dockerfile | 3 ++- test-env/ssh-server/sshd_config | 2 +- test-env/ssh-server/supervisord.conf | 6 ++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/test-env/README.md b/test-env/README.md index 4e7f82f..1b5c378 100644 --- a/test-env/README.md +++ b/test-env/README.md @@ -149,6 +149,12 @@ $ curl 127.0.0.1:21112; curl 127.0.0.1:21113 :) ``` +## How to check ssh server logs + +```sh +$ docker exec mole_ssh tail -f /var/log/messages +``` + ## Packet Analisys If you need to analyze the traffic going through the tunnel, the test diff --git a/test-env/ssh-server/Dockerfile b/test-env/ssh-server/Dockerfile index f7ef740..3bdff92 100644 --- a/test-env/ssh-server/Dockerfile +++ b/test-env/ssh-server/Dockerfile @@ -12,11 +12,12 @@ COPY motd /etc/motd RUN /usr/bin/ssh-keygen -A RUN addgroup -S mole && adduser -S mole -G mole -D -s /bin/ash && usermod -p 'this-is-not-a-valid-hash' mole -RUN mkdir -p /home/mole/.ssh && chown mole:mole /home/mole/.ssh +RUN mkdir -p /home/mole/.ssh && chown mole:mole /home/mole/.ssh && chmod 0700 /home/mole/.ssh RUN chgrp mole /usr/sbin/tcpdump && chmod 750 /usr/sbin/tcpdump && setcap cap_net_raw+ep /usr/sbin/tcpdump COPY authorized_keys /home/mole/.ssh/ +RUN chown mole:mole /home/mole/.ssh/authorized_keys && chmod 0600 /home/mole/.ssh/authorized_keys COPY supervisord.conf /etc/supervisord.conf RUN mkdir -p /var/log/supervisor diff --git a/test-env/ssh-server/sshd_config b/test-env/ssh-server/sshd_config index 76d961f..a9456bc 100644 --- a/test-env/ssh-server/sshd_config +++ b/test-env/ssh-server/sshd_config @@ -5,7 +5,7 @@ PubkeyAuthentication yes PasswordAuthentication no AuthorizedKeysFile .ssh/authorized_keys SyslogFacility AUTH -LogLevel INFO +LogLevel DEBUG1 AllowAgentForwarding yes ClientAliveInterval 3 ClientAliveCountMax 0 diff --git a/test-env/ssh-server/supervisord.conf b/test-env/ssh-server/supervisord.conf index a74fbb2..7739155 100644 --- a/test-env/ssh-server/supervisord.conf +++ b/test-env/ssh-server/supervisord.conf @@ -22,3 +22,9 @@ serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix s [program:sshd] command=/usr/sbin/sshd -D redirect_stderr=true +autorestart=true + +[program:syslogd] +command=/sbin/syslogd +redirect_stderr=true +autorestart=true