You need a SSH tunnel to another machine which is still alive after you close the bash or the Putty window.
The command to solve the problem:
ssh -fN -L 1234:destination_server:4321 username@server
- -f: Force ssh to go to background before one command is executed, but it will display the password prompt.
- -N: Tell ssh not to execute a command (-f would require one command)
- -L: Open a tunnel from the local port 1234 to a destination server with the port 4321.