powershell ssh can't deal with german umlaut in passwords?!

Titan 206 Reputation points
2020-12-28T11:18:52.003+00:00

remote:

  • Raspberry Pi with Raspbian 10 (buster) Lite
  • german keyboard layout
  • locales are de_DE.UTF-8
  • ssh server is running
  • user pi has an password with german umlauts client host:
  • Windows 10
  • Powershell ssh

If I try to connect with ssh, I'd get the following message:
'Permission denied, please try again.'

With a changed password, without german umlauts everything went well.

Also if I use WSL Ubuntu, then I can connect to the remote host with that Umlaut password.

My Question is: What I've made wrong, that powershell ssh can't deal with that umlaut password and how can I fix it?

Windows for business | Windows Server | User experience | PowerShell
{count} votes

Accepted answer
  1. Anonymous
    2020-12-29T06:30:15.033+00:00

    Hi,

    Please check the encoding the console uses to read input with [console]::InputEncoding. You can set it to UTF8

    [console]::InputEncoding = [text.utf8encoding]::UTF8  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2020-12-28T20:26:14.04+00:00

    The problem may be with the code page(s) used by your console. Do you have the same problem if you use ssh from CMD.EXE on the Windows 10 machine?

    From the PowerShell console, "[console]::InputEncoding" will show you the code page used for input. I think "1252" would work for German characters. For output encoding, PowerShell uses TWO code pages! "[console]::OutputEncoding" should be the same as the input encoding. BUT, if you're sending output thru the pipeline to native application, the code page is found in the "$OutputEncoding" variable (which is usually ASCII). You may need to change that to "UTF8Encoding".

    The CMD.EXE uses only one code page. You can see that by using the command "chcp" (and that same command can be used to change the code page).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.