2

I am attempting to log in to my raspberry pi 4b for the first time. I have the wifi file all sorted out and I have a blank file called ssh. I have done ping raspberrypi.local and its shows up and responds. When I try to connect to it using ssh [email protected] it asks for the password. I entered raspberry as it is the default password but it denies it. Does anyone know why this might be happening and what the password might be? It is my first time logging in

8
  • Is this a new install? How did you install? Have you read raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022?
    – Milliways
    Apr 13, 2022 at 0:50
  • I just got the pi 3/4 ish days ago and installed the official OS with Raspberry Pi Imager. I have not read that and I will do that now
    – Pixeled
    Apr 13, 2022 at 0:52
  • @Milliways should I rewrite my microSD card?
    – Pixeled
    Apr 13, 2022 at 0:55
  • Frankly headless install is a black art. Try running with screen and keyboard and it will solve the problem.
    – Milliways
    Apr 13, 2022 at 1:11
  • I can't run with screen and keyboard. i need to connect to the pi which I can't
    – Pixeled
    Apr 13, 2022 at 2:15

4 Answers 4

3

I ran into the same issue. When using the Raspberry Pi imager, apparently you MUST specify the password you want to use otherwise you can't connect via ssh. Probably something to do with this: https://www.bleepingcomputer.com/news/security/raspberry-pi-removes-default-user-to-hinder-brute-force-attacks/

3
  • Ok should I just rewrite my SD card?
    – Pixeled
    Apr 13, 2022 at 12:07
  • Yes, you have to rewrite the SD card with ssh enabled and username and password specified Apr 14, 2022 at 15:55
  • Thank you - it was astonishingly hard to find an answer to this, Google most responded with a ton of pages listing the old default credentials!
    – scubbo
    May 3, 2022 at 6:12
2

I don't know WHY RPT does these things, without any notice and no documentation, and I haven't used the new imager/download, but just follow the "instructions" (some of which are probably impossible if you don't already have a Pi or Linux machine).
This is the way most Linux install works - i.e. assumes you have a screen/keyboard

I always use a screen/keyboard for fresh installs.

You could try Simon Long's Comment:-

"Here is the contents of an example /boot/userconf file:
test:$6$FdsTan/zaR7eKb8B$mSgk/5q/IFMYOVf2e/NdnUfWBi9clSciE1XD2bHsFNDko0k05zouZkbOPjUeDAYTdkLeWWEwjw5Bow0/le/uv1
This sets up a user called ‘test’ with the password ‘pass’ – although bear in mind that if you create an encrypted version of ‘pass’, it is unlikely to be identical to this one, due to the use of what is called a salt to add additional randomness."

Bear in mind that if you do this you would need to change user later with sudo rename-user.

It is probably better to download the latest imager and follow the instructions.

echo 'raspberrypi' | openssl passwd -6 -stdin

produces the following:-

$6$iCCduqhqD1KIBNdu$Z/lTi/pqgbGT2/Rae1EQzNkOyu2Jvaw2wapVGBjV6LPGynxRe4j2jBv5JBeu3YKCiOHlU/e1dbUeQzvx.6bFZ.

The following userconf.txt file should produce pi/raspberrypi pi:$6$iCCduqhqD1KIBNdu$Z/lTi/pqgbGT2/Rae1EQzNkOyu2Jvaw2wapVGBjV6LPGynxRe4j2jBv5JBeu3YKCiOHlU/e1dbUeQzvx.6bFZ.

although I haven't tested.

2
  • Could I just rewrite my SD card and specify a password?
    – Pixeled
    Apr 13, 2022 at 12:09
  • I second that emotion! I submitted a comment to the "blog post", but it was apparently censored, so I'll share it here: "This is a bad idea". But it's a done deal - which won't be un-done, so no point in crying over spilt milk. One thing that would be useful is a script that modifies the modified images to restore the defaults we've had lo these many years. I nominate @Milliways for this job... seconded & unanimously approved. Please keep us posted on progress :)
    – Seamus
    Apr 13, 2022 at 20:55
2

I created a guide with images to do this here:

As per the official raspberry blog at https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022 the default username password will no longer be allowed for headless login. This leads the end user in a conundrum as already raspberry pi4’s new HDMI connector cable is not readily available.

Basically there are two methods

  1. Use the updated raspberry pi imager too from here

  2. manually add userconf file in the boot directory with username:encrypted-password as a single line. to generate encrypted-password string use echo 'mypassword' | openssl passwd -6 -stdin tested on win 10

1

Default username and password is not valid any longer for raspberry Pi. If you are trying to login headlessly (without monitor/keyboard) you can do it from Pi Imager itself. On Selecting OS in Pi Imager you get an icon of settings in which you can

  • create a user
  • setup wifi
  • enable ssh

After configuring , you can continue flashing your Memory Card. And on first boot you will be good to go

2
  • Jul2023: Used imager: It added a user/password just fine, but I also enabled SSH and that was NOT enabled when I booted. If anyone else has this issue, just add the 'ssh' file to main SD card as we use to do on headless. SSH then worked and was able to use the user/password I created under imager.
    – B. Shea
    Jul 19 at 0:14
  • Yes, this is a good trick by adding an ssh file to the root of the SD card. And the imager also allow you to tick if you want to enable ssh by default on the first boot.
    – Decoy
    Jul 28 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.