Raspberry Pi SSH Access Denied

Viewed 17210

I am trying to log into my Raspberry Pi using PuTTY from Windows. However, whenever I try to log into my Raspberry Pi using the default username and password (pi* and raspberry) it says Access Denied.

I have the wpa_supplicant.conf file and ssh file created. This is its first bootup. I am using the latest version of the Raspbian Lite OS.

3 Answers

Recently, the default user setup of Raspbian was significantly changed, rendering most existing online tutorials invalid.

In essence, the default pi user no longer exists, so you have to create it and set its password using either the official Imager tool or by creating a userconf file in the boot partition of your microSD card, which should contain a single line of text: username:hashed-password, replacing username with the name of the user you want (e.g., pi) and hashed-password with the hash of the password you want.

According to the official guide, the easiest way to do this is by running the following in a terminal (Linux or macOS):

echo 'password' | openssl passwd -6 -stdin

Again, you should replace password with the password you want here.

Further reading: An update to Raspberry Pi OS Bullseye (2022-04-07)

The default username and password are no longer valid for Raspberry Pi.

If you are trying to log in headlessly (without a monitor and keyboard), you can do it from Raspberry Pi Imager itself. On selecting the OS in Raspberry Pi Imager, you get an icon of settings in which you can

  • create a user
  • setup Wi-Fi
  • enable SSH

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

I have solved this problem. You can easily input your username and password with Raspberry Pi Imager.

Screenshot of an example of using "Advanced Options" in Raspberry Pi Imager

Related