This is one of the powerful feature which one can use, when there is no more ports open to a server other then ssh port ie port 22.
Let say i need to access use MQ browser from my local client for browsing MQ objects on the server, and you have only ssh connection open to the server in other words we have only port 22 open to the server rest all the ports are blocked from the firewall.
let say MQ server is ruinning on port 4040 and the server ip is 10.10.40.40, you need to access these server via MQ browser, since port 4040 on the server will not be accessible from your local machine. to solve this issue we need any ssh client. let say we have putty (commonly used) or cywin.
we need to run any of these commands depending on the ssh clinet you have.
C:\Users\Administrator>C:\Users\Administrator\Desktop\putty.exe -T email@example.com -L 127.0.0.1:4040:10.10.40.40:4040
“C:\cygwin\bin\ssh” -T firstname.lastname@example.org -L 127.0.0.1:4040:10.10.40.40:4040
it will promt for the password, once you enter the password, the port will be available on your local machine , as if the service is hosted on your local machine.