Dockerfile
:
FROM alpine
RUN echo a > a
COPY b .
NC does not close the network connection as it does not receive EOF. We need to 'timeout' or close the connection after a short period. This can be achieved by putting a sleep command into the stdin being passed to nc.
(echo "password 1234"; sleep 2) | nc -q 0 localhost 30002
...or by adding a maximum wait-time to the netcat connection
echo "password 1234" | nc -w 1 localhost 30002
(a small 1 second wait-time seems to be sufficient for the nc listener to respond and close safely.)
This gist aims to be an incomplete set of steps to provide additional hardening of a default Ubuntu Server installation. The following guides and configurations have been collated from man pages; source documentation; and online guides / best practices.
This document will focus on production Ubuntu server installations, not desktop configurations. Please note : your requirements may differ, use at your own risk.
This is a live document which I hope to update with new findings.