Report this

What is the reason for this report?

Command line hangs when trying to make ssh tunnel

Posted on June 14, 2021

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.



This textbox defaults to using Markdown to format your 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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.