Taylor TR Blog

Welcome to Taylor's Tech Blog


General | K8s

SSH JumpProxy and Socks Proxy

September 18, 2023 | General

I have a server at home, that I like to open as few ports as necessary. Right now I'm running one game server, and a wireguard VPN server. However, the VPN software on my work laptop doesn't allow the use of other VPN clients. So I can't connect to my home environment to access my private services. One thing I'd like to at least be able to do is access certain web services, like my router, if I want to adjust ports.

Since my home has a static ip, and my cloud server has a static IP. I can use my cloud server as an ssh jump box to connect back home. It's the only server that I still have ssh open to the world (via public keys only, at least). After a lot of testing, I finally managed figure out the JumpProxy command, which both ChatGPT, and stack overflow answers weren't providing properly at the time. At least not in the top google searches I came across.

Here's the command

ssh -J <cloud_server> -D <sock_port> <home_server>

This feels counterintuitive, since I can't reach my home server directly. But this is where the magic of -J comes in. It prompts me for my ssl passphrase twice. Once to connect to the cloud server, and again to connect to home server. This is also nice, because it means I don't have to add the public key of Cloud_server into my home server if I don't want to. While Cloud Server's public key is in fact on my home server, I leave it commented out in the authorized_keys file until I actually need it to transfer files or perform other tasks.

To simplify this, you can configure it in the .ssh/config file

Host socks
    HostName <home_server>
    user <username>
    ProxyJump <username>@<cloud_server>:<ssh_port>

At last, with this in place, I can easily open a socks proxy to home and access web interfaces on my home servers, even if I'm unable to connect to my VPN. I keep Mozilla Firefox around just for this purpose. It essentially serves my dedicated proxy browser for connecting to socks proxies from anywhere.

If you have any questions or comments, leave them for me on threads