Skip to content

Commit

Permalink
Merge pull request #98 from davrodpin/test-env/fix-sshd-logs
Browse files Browse the repository at this point in the history
Fix ssh server logs on test env. container
  • Loading branch information
davrodpin authored Oct 3, 2019
2 parents 14544f9 + 4bacfdc commit 460cddc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions test-env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test-env/ssh-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test-env/ssh-server/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PubkeyAuthentication yes
PasswordAuthentication no
AuthorizedKeysFile .ssh/authorized_keys
SyslogFacility AUTH
LogLevel INFO
LogLevel DEBUG1
AllowAgentForwarding yes
ClientAliveInterval 3
ClientAliveCountMax 0
6 changes: 6 additions & 0 deletions test-env/ssh-server/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 460cddc

Please sign in to comment.