I want to make an SSH connection

e.g ssh pi@ -p 22

SSH connection can only be made when connected to VPN tunnel. I can connect to VPN tunnel like this

echo PASS | sudo openconnect --juniper https:/example/ -u user --passwd-on-stdin

Now the SSH connection works!


When I'm connected to the tunnel it changes my public IP to Because of that my web server dosen't work. Because it routes all the traffic trough tunnel.

I want to send SSH command through VPN connection, but I don't want my VPN to route all the traffic.

How can I do this?

What I tried so far

I tried to make an bash script that connects to the network and then sends ssh command and after that disconnects, but thats really bad solution.

Also tried openSSH ProxyCommand, but I think misunderstood that

ssh -o ProxyCommand="echo PASS | sudo openconnect --juniper https://example/ -u user --passwd-on-stdin" user@host

I saw post about openVPN using route-nopull

But I'm not sure how to redirect traffic with OpenConnect

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.