The issue is likely because when your PC connects to the VPN, all its traffic is routed through the VPN tunnel, including incoming SSH connections. Here are some ways to fix this:
Check firewall rules: OpenVPN may modify iptables rules and block incoming connections. Try temporarily disabling the firewall with:
bash
CopierModifier
sudo ufw disable
Then test the SSH connection.
Port forwarding on the VPN: VPNBook likely does not support incoming connections. Your PC is behind the VPN’s NAT, so SSH cannot reach it via the VPN IP. You would need a VPN provider that supports port forwarding (like Mullvad or PIA).
Use split tunneling: If your goal is to hide outgoing traffic while keeping SSH accessible, you can configure OpenVPN to exclude SSH from the tunnel using the route-nopull
option and specific routes for your VPN server.
Do you need SSH access only locally or also through the VPN IP?