Skip to content

Instantly share code, notes, and snippets.

@Jpuelpan
Last active October 22, 2018 03:47
Show Gist options
  • Save Jpuelpan/9f39a0085f1e230b05431d74a5c7e06d to your computer and use it in GitHub Desktop.
Save Jpuelpan/9f39a0085f1e230b05431d74a5c7e06d to your computer and use it in GitHub Desktop.
Tunneld systemd.service
[Unit]
Description=Tunnel Client
After=network.target
[Service]
User=root
Restart=always
WorkingDirectory=/etc/tunnel
SyslogIdentifier=tunneld-client
ExecStart=/usr/bin/tunnel -config /etc/tunnel/tunnel.yml start-all
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
[Unit]
Description=Tunneld Server
After=network.target
[Service]
User=root
Restart=always
WorkingDirectory=/etc/tunneld
SyslogIdentifier=tunneld-server
ExecStart=/usr/bin/tunneld -tlsCrt /etc/tunneld/server.crt -tlsKey /etc/tunneld/server.key -httpAddr :8080 -httpsAddr :8443
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
server_addr: SERVER_IP:5223
tunnels:
ssh:
proto: tcp
addr: 127.0.0.1:22
remote_addr: 0.0.0.0:XXXX
@Jpuelpan
Copy link
Author

$ openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout client.key -out client.crt
$ openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout server.key -out server.crt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment