Skip to content

Instantly share code, notes, and snippets.

@alexmelyon
Created November 28, 2022 19:01
Show Gist options
  • Save alexmelyon/727ce985a57e99dba626c8f9e05177aa to your computer and use it in GitHub Desktop.
Save alexmelyon/727ce985a57e99dba626c8f9e05177aa to your computer and use it in GitHub Desktop.

Connect OpenVPN through ssh tunnel

Create your vpn server with ssh access. I use pq.hosting

https://pq.hosting/

In /etc/openvpn/server.conf make TCP protocol

proto tcp

Restart OpenVPN service

$ systemctl restart [email protected]

Make sure your SSH server can port forward. /etc/ssh/sshd_config

GatewayPort yes

Restart SSHD service

$ systemctl restart sshd.service

Change .ovpn client file

proto tcp

On your local machine start local port forwarding

ssh -L 1194:localhost:1194 root@server

Connect your OpenVPN Client to localhost

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