Command line hangs when trying to make ssh tunnel

I was following this tuitorial and was on step 3. Now as I try to make the ssh tunnel, my command line gets stuck when I enter the password. It doesn’t terminate or show any error but just gets stuck

I used ssh -L 59000:localhost:5901 -C -N -l sammy your_server_ip command from my local system(Windows). I replaced sammy by my non-root username and your_server_ip with the linux server ip address. It asks for my password, I provide it and then the command line gets stuck. Any help is appreciated, thanks in advance.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I believe that this is the expected behavior. That way you open a tunnel which is available for your current session, then by pressing CTRL+C the tunnel will be terminated.

If you want to SSH to the host, you could omit the -C and the -N flags.

Hope that this helps. Regards, Bobby