Run below command on machine A. It starts a SOCKS server listening on the port 8080, and forwards all traffic to that SOCKS server to the remote host, over the secure channel.
# ssh -C -D :8080 -N <username>@<remote-host>
ssh -C -D :8080 -N test_user@1.2.3.4
Note the value of the -D
option, :8080
, which is prefixed with a :
.
-D :8080
means the listening port is bound to all interfaces of machine A, not just to
localhost
.
Other machines in the same local network now can access that SOCKS proxy using the IP address of machine A.
Also configure the network settings on machine A to use a fixed IP address, so that other machines don’t have to update the SOCKS proxy IP often. (Choose “Using DHCP with manual address” in MacOS Network settings.)
This is a workaround to fix the broken SSH tunneling after I upgraded my Mac to MacOS 15.0 Sequoia.