Page 1 of 1

PI 3b+ SSH password refused by network, not by local keyboard

Posted: Thu Mar 22, 2018 8:41 am
by Alexandre34
Hello.
I have problem to connect with SSH with the 2018-03-13-raspbian-stretch-lite. I have not this problem with 2017-11-29-raspbian-stretch-lite. See below what i have done.

1) Put 2018-03-13-raspbian-stretch-lite on a brand new SD card
2) Put an empty file ssh in the boot partition
3) Put the sd card in a pi3b+ connected to my network and a screen and powered up
4) Try to connect from my computer (Win7) to the IP adress with Bitwise SSH client
5) There is an key exchange going on:

Code: Select all

09:32:42.291 Started a new SSH2 session.
09:32:42.322 Connecting to SSH2 server 192.168.1.13:22.
09:32:42.322 Connection established.
09:32:42.353 Server version: SSH-2.0-OpenSSH_7.4p1 Raspbian-10+deb9u3
09:32:42.384 First key exchange started.
09:32:42.493 Received host key from the server. Algorithm: ECDSA/nistp256, size: 256 bits, MD5 fingerprint: 02:c7:84:cd:9e:cd:ff:ca:53:3c:55:e9:a8:b9:37:24, Bubble-Babble: xodeh-gufom-tuzut-pufan-fofyd-govik-dafeg-batyd-zebeb-mylan-kuxyx, SHA-256 fingerprint: oGR1IviRlccby/oxvlH9cQRzK7WK9k33OBjIpTjh/FM.
09:32:42.509 First key exchange completed using ecdh-sha2/nistp521. Session encryption: aes256-ctr, MAC: hmac-sha2-256, compression: none.
09:32:42.525 Attempting password authentication.
09:32:44.599 Authentication failed. Remaining authentication methods: 'publickey,password'.
Of course, I use the default password raspberry (rqspberry with my French Keyboard)
6) I plug the keyboard into the raspberry, login (pi/raspberry), and type

Code: Select all

ssh -l pi 127.0.0.1
The ssh server ask the password. I type it (rqspberry) and ssh accept it and open the session !!!

Why ssh does not accept the password when sended by network, but accept it from a local session ???

Re: PI 3b+ SSH password refused by network, not by local keyboard

Posted: Thu Mar 22, 2018 9:10 am
by Ernst
The password is "raspberry" and not "rqspberry", but you have to type "rqspberry" because initially the Raspberry Pi uses the UK keyboard layout and this layout is different from the layout on the keyboard attached to the Pi. What happens is that you have to press the key labelled "q" for the driver to see the code for the character "a".
When you use ssh on Windows 7, with your french keyboard with the french layout selected, you do not have to type "rqspberry" because the Windows keyboard layout ensures that the key labelled "a" will send the character "a" to the pi.

The same is valid for users with a german keyboard, with the english keyboard layout the password to be entered on a german keyboard attached to the Pi is "raspberrz" because the key labelled "z" is seen as the character "y". But with ssh from Windows with a german keyboard and the german layout selected the password is "raspberry" because Windows translates the key labelled "y" to the character "y" and sends this to the Pi.

Re: PI 3b+ SSH password refused by network, not by local keyboard

Posted: Thu Mar 22, 2018 10:18 am
by Alexandre34
I am pretty sure that the problem is not about the keyboard layout issue. Neither rqspberry or raspberry are OK thrue network login, but rqspberry is Ok (as expected) with direct loging.

Re: PI 3b+ SSH password refused by network, not by local keyboard

Posted: Thu Mar 22, 2018 6:34 pm
by Ernst
Alexandre34 wrote:
Thu Mar 22, 2018 10:18 am
I am pretty sure that the problem is not about the keyboard layout issue. Neither rqspberry or raspberry are OK thrue network login, but rqspberry is Ok (as expected) with direct loging.
When you login through the rqspberry loopback adapter (127.0.0.1) you are using the rqspberry keyboard setting, when you login from Windows using ssh to the raspberry pi you are using the Windows keyboard setting. Your keyboard is not the problem, it is the keyboard setting on the rqspberry (default UK), because the rqspberry keyboard driver translates your key labelled "Q" to the character code 0x61 ("a") which is what the raspberry expects. (see https://en.wikipedia.org/wiki/AZERTY & https://en.wikipedia.org/wiki/QWERTY).

Re: PI 3b+ SSH password refused by network, not by local keyboard

Posted: Fri Mar 23, 2018 7:01 am
by Alexandre34
So rqspberry should work, but it does not.
Edit: After new tests. If I put a password suitable for both French and UK keyboard, e.g 'erty', it works... I can log thrue ssh
Even if I change my local settings with raspi-config, the 'a' is not accepted by ssh in the password.
But if I use a password without 'a', I can log with ssh, and the 'a' is display 'a', as expected

And if I change back the password thrue ssh to 'raspberry', I can log with 'raspberry'.

Very very strange... Many some odd behaviour between my ssh client (bitwise ssh) and raspian

So I any reader have the same problem:
1) With keyboard attached to pi, change password to a trivial one, e.g 'erty'
2) Log with ssh with this password
3) Change with raspi-config THRUE SSH to the password you want
4) and reboot