[Bug 3704] Implement an interface to capture port number of random remote port forwarding -R 0:localhost:22
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Fri Aug 9 22:23:03 AEST 2024
https://bugzilla.mindrot.org/show_bug.cgi?id=3704
kolAflash at kolahilft.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kolAflash at kolahilft.de
--- Comment #2 from kolAflash at kolahilft.de ---
(In reply to Nikola from comment #1)
> [...]
> You can use a unix socket instead as it will be easier to track.
If possible, I'd also recommend UNIX sockets. They are much safer then
127.0.0.1. See also bug 3695
Comments say even Windows supports UNIX sockets nowadays:
https://lwn.net/Articles/984838/
Alternatively let not SSH find the free port, but use "ss".
#!/bin/bash
port="10000" # start searching here
while [ -n "$(ss -tan4H "sport = ${port}")" ]; do
port="$((port+1))"
done
--
You are receiving this mail because:
You are watching the assignee of the bug.
More information about the openssh-bugs
mailing list