How to make remote connection (ssh tunnel) with putty/ssh?
Solution 1:
Depends on which setup you want:
SETUP 1) server is listening
ssh tunel LAN destination
SERVER (listen on port 6000) ==========> LAPTOP -----> ip:port
(LAN destination could also be localhost:port to connect laptop itself)
PUTTY SETUP: right click on putty window title, choose Change settings / Tunnels and fill in:
source port: 6000
destination: ip:port (or hostname:port)
select "Remote"
SSH: ssh -R 6000:hostname:port
SETUP 2) laptop is listening
ssh tunel destination
LAPTOP (listen on port 7000) ==========> SERVER -----> ip:port
again, the destination could be localhost:port to connect to server itself.
PUTTY setup:
source port: 7000
destination: ip:port (or hostname:port)
select "Local"
SSH: ssh -L 7000:hostname:port
In both cases, you can also specify (in putty by a checkbox) if the listening LAPTOP/SERVER also accepts connection from other hosts.