My favorite use of this is peer-to-peer transfer of Docker images. The Docker CLI only allows you to use registries authenticated with HTTPS but there's an exception where it allows HTTP transfers over localhost. So, if you use SSH tunneling to forward a port from localhost to a remote, then Docker unwittingly pushes to a remote. This is super useful "off the grid" with robotics/embedded applications where you don't…
That's not quite true, you just need to add the `insecure-registries`[1] option with a list of either IP (or ip ranges) or hostnames that you want to allow without TLS. ```/etc/docker/daemon.json { "insecure-registries": ["10.100.0.0/24", "registry.yourmom.example.com:5000"] } ``` [1] https://docs.docker.com/reference/cli/dockerd/#insecure-regi...
A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
51–60 of 83 posts
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#52Learning how SSH port forwarding is great as a pseudo-vpn for everything from GUI-client database access to (in physical infra) access to web-admin tools for appliances. The socks proxy support can also deal with bad web filtering and privacy issues on public wifi networks (though nowadays if you're ssh'ing to a cloud IP, you'll get lots of "bot" restrictions).
Yeah, I get use out of the SOCKS proxy mode in combination with a "split VPN" at work. I need VPN to get into some internal resources via SSH, but there are lots of external/public/AWS resources I also need to access, and the full VPN adds too much overhead and fragility for those. Using the available split VPN, I can point a browser instance at a localhost SOCKS proxy port to relay over SSH + VPN for other web resou…
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#53The article mentions bastions, but no jumphosting? ssh -J user1@bastion1,user2@bastion2 targetuser@targethost Edit: Jumphosting was introduced in OpenSSH 7.3 2016-08-01. https://www.openssh.org/releasenotes.html
Match host="MyHost" exec "! grep Home ~/.wifi-loc-control/.current"
ProxyJump home-jumphost.mydomain.tldRe: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#54Learning how SSH port forwarding is great as a pseudo-vpn for everything from GUI-client database access to (in physical infra) access to web-admin tools for appliances. The socks proxy support can also deal with bad web filtering and privacy issues on public wifi networks (though nowadays if you're ssh'ing to a cloud IP, you'll get lots of "bot" restrictions).
I just love SOCKS proxy in SSH tunnels: at some point I had a dedicated server (on a fixed IP) with countless machines (usually headless Pis dropped at a family member's place and/or SME office) automatically setting up, 24/7, reverse tunnels to that dedicated server.
Then I could, from anywhere, both access their LANs (to fix stuff) and have a browser, running locally, pretending to be in this or that country.
Basically because I had all those reverse tunnels always there, I could always decide how to use them (just SSH in or SOCKS in etc.).
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#55I then use nginx to proxy it.
Because its a unit file, sshd reconnects if my ISP's IP changes. Does so within 30s. Also hides my ISP IP in case I have to turn it off.
And no data is effectively on the VPS. Its just a mostly empty machine.
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#56Also annoys me we "invented" ssh:// url format after the tools were baked so it's a somewhat odd bonding into the model.
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#57Earlier quoted context omitted.
Important to note that `~` SSH commands work only right after you press Enter - it doesn’t trigger everywhere you press `~`. Also EnableEscapeCommandline fortunately only affects `~C` - the all-important `~.` to kill a hung SSH session still works with it disabled.
so many time i have inadvertently ended a session with a fat fingered ~.
That was a nightmare to triage back in the late 90s when I did it. Thankfully Ctrl-Q (I think it’s Q) “resumes”, so, easy fix if you know what you’ve done.
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#58Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#59Earlier quoted context omitted.
That's not quite true, you just need to add the `insecure-registries`[1] option with a list of either IP (or ip ranges) or hostnames that you want to allow without TLS. ```/etc/docker/daemon.json { "insecure-registries": ["10.100.0.0/24", "registry.yourmom.example.com:5000"] } ``` [1] https://docs.docker.com/reference/cli/dockerd/#insecure-regi...
Yes this is true. I should caveat that we distributed the tool among a team and we didn't want to ask them to all edit their daemon.json with an ever-expanding list of IP addresses.
Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding
#60The article mentions bastions, but no jumphosting? ssh -J user1@bastion1,user2@bastion2 targetuser@targethost Edit: Jumphosting was introduced in OpenSSH 7.3 2016-08-01. https://www.openssh.org/releasenotes.html
And this allows me to have zero open ports on my home internet. I do a reverse tunnel to my VPS from my home server (in a FreeBSD jail), and that port is what my laptop client jumps through.