Can't login via SSH

July 19, 2024, 22:23

imspikyz

I recently bought a Pi 5 and am completely new to all of this. I installed Raspberry Pi imager and edited the settings and created a user name and password and also enabled SSH. I then put the micro sd into the Pi and opened command prompt to SSH into the pi. It asks for my password and I input the one I created on imager but it says password denied. I then put the micro sd back into my computer to check the password and it completely changes it to a long password in which I cannot see. I want to know why it switches it and how I can figure out what the password is. Thanks.

thunder07337

The password is saved as a hash, not as plain text. Enter the password in the user name and see if it is spelled correctly.

oops.se

As you didn't provide the command you entered to start the ssh session it is hard to give a good answer. If you just used ssh without a username it will take the username from host that you try to login from and if that isn't the same username as on the pi then....

imspikyz

ssh pi@‘ip address’

imspikyz

Obviously ip address is changed to an actual ip

imspikyz

So what would the password be if it is not plain text ?

thunder07337

It is a hash of the plain text! Your input is also converted to a hash and then the two hashes are compared. Have you also entered "pi" as a user in the imager?

imspikyz

The host name is pi.local but my username is something different

imspikyz

I don’t get it though is there a way to see what the password actually is then?

thunder07337

Then it's the wrong username!
ssh username@hostname
or
ssh username@ip-address

imspikyz

Thank you so much it fixed it