Live data from Hacker News

A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

labs.iximiuz.com

11–20 of 83 posts

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#13
post #4

The 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

It is surprising how many times I see this content (this version might be marked “Published: Jun 19, 2026” but I've definitely seen those exact diagrams before, starting at least a few years ago, and the same content around them in many tutorials before that) without it being updated to mention jump-hosts.

Support was added to OpenSSH about a decade ago? Even on a low moving Linux distro like Debian/LTS everyone should have support by now.

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#15
I'll mention it here, because I learned about it here.

"~C" will drop you into the SSH command line, allowing you to, among other things, effect port forwarding

  -L8080:localhost:443
Learning that "~C" exists, and what you can do with it, has supercharged my use of SSH tunnels, which were already awesome on their own.

But for some reason this has been disabled by default in more recent ssh configurations... to ensure its available

  -o EnableEscapeCommandline=yes
or, in your ~/.ssh/config

  EnableEscapeCommandline yes
(edit: formatting)

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#16

I'll mention it here, because I learned about it here. "~C" will drop you into the SSH command line, allowing you to, among other things, effect port forwarding -L8080:localhost:443 Learning that "~C" exists, and what you can do with it, has supercharged my use of SSH tunnels, which were already awesome on their own. But for some reason this has been disabled by default in more recent ssh configurations... to ensure…

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.

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#17
post #4

The 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

It is surprising how many times I see this content (this version might be marked “Published: Jun 19, 2026” but I've definitely seen those exact diagrams before, starting at least a few years ago, and the same content around them in many tutorials before that) without it being updated to mention jump-hosts. Support was added to OpenSSH about a decade ago? Even on a low moving Linux distro like Debian/LTS everyone shou…

[deleted]

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#18
post #7

When I see one of these with obvious AI tells at the top (sentences lacking a subject or verb), I ask myself: Can’t I just open up a harness and prompt “Teach me how to do X?”

I do this all the time, I have a skill/gem with instructions on how I want to receive info, how to format and so on. Really helps to go fast to get the point.

Could you share it? I'd be interested to get idea to make my own

Re: A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

#20
post #2

It’s amazing what you can learn by reading the manual.

It is, because manuals are often not the best way to learn things. Most software manuals are reference manuals. SSH man page isn't too bad. I learned most of my SSH knowledge from it, but I'm not sure it's the best way to do it.

For me, the best way to learn a tool is for a quick example or two showing its utility, then practicing with those, reading the man as needed on specific flags. Google or bot ”how do x" ? Repeat : done

Some pages have a nice up-front synopsis of flags, others put them in a wall of text. Browsing the former can supplant Google, /\b-x while paging is helpful for the latter.

Post reply on HN