Create SSH service reverse proxy
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
FROM debian
|
||||||
|
|
||||||
|
ADD . /app/
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
RUN apt-get install -y gcc automake autoconf libssl-dev pkg-config git make ppp ssh
|
||||||
|
|
||||||
|
RUN git clone https://github.com/adrienverge/openfortivpn
|
||||||
|
|
||||||
|
WORKDIR /app/openfortivpn
|
||||||
|
|
||||||
|
RUN ./autogen.sh
|
||||||
|
|
||||||
|
RUN ./configure --prefix=/usr/local --sysconfdir=/etc
|
||||||
|
|
||||||
|
RUN make
|
||||||
|
|
||||||
|
RUN make install
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
CMD bash docker-entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE 22
|
11
docker-entrypoint.sh
Normal file
11
docker-entrypoint.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
openfortivpn -c vpn.conf &
|
||||||
|
|
||||||
|
sleep 3s
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
ssh -o "ExitOnForwardFailure yes" -NL 22:192.168.80.240:22 localhost
|
||||||
|
sleep 1s
|
||||||
|
done
|
Reference in New Issue
Block a user