In my setup, first I need to connect to a VPN and then I am required to ssh into a server.
Currently I do like this:
openvpn myconfig.ovpn
ssh myuser@myserver
which makes all my network traffic go through that VPN.
However, I do not want all my data traffic to go through this VPN. Using GNU/Linux, which tools do I use to use a VPN only in one specific ssh connection?
That is, which tools can I use into a bash script to be able to do the following:
ssh-over-vpn.sh myuser.ovpn [email protected]
and to use the vpn config only for the ssh connect to [email protected] ?
My current myuser.ovpn configuration file has:
client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote 200.200.200.18 443
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-GCM
setenv opt block-outside-dns
key-direction 1
verb 3
<ca> ... </ca> <cert> ...<key> ...<tls-auth> ...