root 5 years ago
commit a2b0b3063e

6
.gitignore vendored

@ -0,0 +1,6 @@
# Try to prevent ssh keyfiles from accidentally reaching git.
*id_rsa*
*key*
*priv*
*ssh*

@ -0,0 +1,19 @@
FROM alpine:3.10
ADD ./id_rsa.pub /root/.ssh/authorized_keys
RUN apk add --update openssh shadow \
&& rm -rf /rmp/* /var/cache/apk/* \
&& chown root:root /root/.ssh/authorized_keys \
&& chmod 700 /root/.ssh \
&& chmod 700 /root/.ssh/authorized_keys \
&& mkdir -p /var/run/sshd \
&& ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa \
&& ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa \
&& usermod -p '*' root \
&& sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/g' /etc/ssh/sshd_config \
&& sed -i 's/GatewayPorts no/GatewayPorts yes/g' /etc/ssh/sshd_config \
&& printf "\nMatch User root\n AllowTcpForwarding yes\n X11Forwarding no\n AllowAgentForwarding no\n ForceCommand /bin/false" >> /etc/ssh/sshd_config
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]

@ -0,0 +1 @@
docker build . -t ssh-reverse-proxy && docker run -d -p 2222:22 -p 22222:22222 --name ssh-test ssh-reverse-proxy

2
rm

@ -0,0 +1,2 @@
docker stop ssh-test && docker rm ssh-test
rm ~/.ssh/known_hosts

@ -0,0 +1 @@
docker exec -it ssh-test sh
Loading…
Cancel
Save