Skip to content

Commit 460cddc

Browse files
authored
Merge pull request #98 from davrodpin/test-env/fix-sshd-logs
Fix ssh server logs on test env. container
2 parents 14544f9 + 4bacfdc commit 460cddc

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

test-env/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ $ curl 127.0.0.1:21112; curl 127.0.0.1:21113
149149
:)
150150
```
151151

152+
## How to check ssh server logs
153+
154+
```sh
155+
$ docker exec mole_ssh tail -f /var/log/messages
156+
```
157+
152158
## Packet Analisys
153159

154160
If you need to analyze the traffic going through the tunnel, the test

test-env/ssh-server/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ COPY motd /etc/motd
1212
RUN /usr/bin/ssh-keygen -A
1313

1414
RUN addgroup -S mole && adduser -S mole -G mole -D -s /bin/ash && usermod -p 'this-is-not-a-valid-hash' mole
15-
RUN mkdir -p /home/mole/.ssh && chown mole:mole /home/mole/.ssh
15+
RUN mkdir -p /home/mole/.ssh && chown mole:mole /home/mole/.ssh && chmod 0700 /home/mole/.ssh
1616

1717
RUN chgrp mole /usr/sbin/tcpdump && chmod 750 /usr/sbin/tcpdump && setcap cap_net_raw+ep /usr/sbin/tcpdump
1818

1919
COPY authorized_keys /home/mole/.ssh/
20+
RUN chown mole:mole /home/mole/.ssh/authorized_keys && chmod 0600 /home/mole/.ssh/authorized_keys
2021

2122
COPY supervisord.conf /etc/supervisord.conf
2223
RUN mkdir -p /var/log/supervisor

test-env/ssh-server/sshd_config

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PubkeyAuthentication yes
55
PasswordAuthentication no
66
AuthorizedKeysFile .ssh/authorized_keys
77
SyslogFacility AUTH
8-
LogLevel INFO
8+
LogLevel DEBUG1
99
AllowAgentForwarding yes
1010
ClientAliveInterval 3
1111
ClientAliveCountMax 0

test-env/ssh-server/supervisord.conf

+6
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix s
2222
[program:sshd]
2323
command=/usr/sbin/sshd -D
2424
redirect_stderr=true
25+
autorestart=true
26+
27+
[program:syslogd]
28+
command=/sbin/syslogd
29+
redirect_stderr=true
30+
autorestart=true

0 commit comments

Comments
 (0)