Skip to content

Instantly share code, notes, and snippets.

@tianchaijz
Created January 12, 2024 02:28
Show Gist options
  • Save tianchaijz/36d489187dacabc83ad3873c4cb39494 to your computer and use it in GitHub Desktop.
Save tianchaijz/36d489187dacabc83ad3873c4cb39494 to your computer and use it in GitHub Desktop.
  1. Gen cert
openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout client.key -out client.crt -subj "/C=US/ST=FL/L=Ocala/O=Company/CN=x.org"
  1. tunnel.service
[Unit]
Description=tunnel
Documentation=https://github.com/mmatczuk/go-http-tunnel

[Service]
Restart=always
RestartSec=30
ExecStart=/opt/tunnel/tunnel -config /opt/tunnel/local.yml start-all

# systemd.exec
ProtectHome=yes
ProtectSystem=full

[Install]
WantedBy=multi-user.target
  1. local.yml
tls_crt: /opt/tunnel/client.crt
tls_key: /opt/tunnel/client.key
server_addr: remote-server-address
tunnels:
  ssh:
    proto: tcp
    addr: 127.0.0.1:22
    remote_addr: 0.0.0.0:6622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment