6

I am trying to connect to my OpenWRT router using SSH. Since Windows 10 comes with a SSH client I decided to use that.

When I try to connect nothing happens when I paste into the password field.

My password is 30+ char with special characters. There seems to be no way to paste the password.

enter image description here

Is this a bug in the Windows SSH client / Terminal?

I have no problem pasting into the terminal. It is only that password field I have issues with. Nothing happens when I paste anything there.

Tony
  • 1,394
  • 5
  • 22
  • 48

3 Answers3

6

Usually the password for ssh never appears even if you type or paste (no characters or stars for security reasons)

You can try to past your password using Ctrl+V (it should work as expected).

You can also paste into the PowerShell window, using right click, as described here

Then you can hit Enter to log in

Chris
  • 185
  • 9
  • I an easily paste into the termnal. It is only that password field i have issues with. Nothing happens when i paste – Tony Oct 09 '20 at 09:39
  • 1
    Have you tried pasting and then hitting Enter to login? – Chris Oct 09 '20 at 09:40
3

The answers to Copy and Paste in Windows PowerShell (the link given in the other answer by Chris) suggest 5 different ways to paste text. They all work on the plain command line, but only 3 of them work for the ssh password (or when entering any text into the ssh app, such as after you've successfully logged in).

The five are:

  1. press right-click on the mouse
  2. use the mouse to open the context menu and click the Edit > Paste option
  3. hit Ctrl + V on the keyboard
  4. use the keyboard to access the context menu's Edit > Paste option: Alt + Space, then E, then P
  5. if the "Use Ctrl+Shift+C/V as Copy/Paste" option is activated, hitting Ctrl + Shift + V on the keyboard

The three that work for ssh are numbers 1, 2 and 5. (As the other answers mention, the ssh login prompt doesn't echo the pasted characters, and you'll need to press Enter after pasting.)

Why don't all 5 methods work?

The tool-tip for the option for number 5 gives a hint as to what's going on.

screenshot of Windows PowerShell Properties window, Options tab, showing tooltip on "Use Ctrl+Shift+C/V" option

It says "regardless of input mode". The options dialog also has a new console features link, which has the following:

If you run in processed input mode, the shortcuts below apply, but in other modes, your application must handle them

(where "shortcuts below" include Ctrl + V)

So I think that ssh runs in a mode other than "processed input mode" (and doesn't itself handle those shortcuts in the expected way) which is what apparently causes methods 3 and 4 to not work.

JustATrick
  • 450
  • 5
  • 10
2

It is default in the linux security model. When you type password in ssh, the password never shows up as you type. But if you paste, it invisibly gets pasted. Then you can hit ENTER. Windows OpenSSH client has also got this behaviour.

Wasif
  • 14,755
  • 3
  • 14
  • 34