zapp7
Posts: 1
Joined: Mon Apr 18, 2022 9:17 pm

Setting the SSH password with Pi Imager is not working for me

Mon Apr 18, 2022 9:21 pm

Using Pi Imager 1.7.2 to install Raspbian Lite 32 bit on an SD card. I click the cog and enable SSH, set my username and password, then write to the card. When I plug the card into my Pi and attempt to SSH in, it just says access denied. I have tried multiple times, reinstalling Pi Imager, and even tried a different SD card, but the problem persists. Spent all afternoon on this and I have no clue how to proceed. (On a side note, I really miss the default pi/raspberry login right now...)

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Setting the SSH password with Pi Imager is not working for me

Tue Apr 19, 2022 2:22 am

Give this a try:

1. Write 2022-04-04-raspios-bullseye-armhf-lite.img to an SD card using Etcher.

2. Create a file named user userconf (or userconf.txt) containing the following:

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
3. Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.

4. Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.

AlessandroHDO
Posts: 1
Joined: Thu Apr 21, 2022 9:01 pm

Re: Setting the SSH password with Pi Imager is not working for me

Thu Apr 21, 2022 9:12 pm

I had the same issue. When I inserted the password, It gave me "Access denied". :evil:
I found out that in the last version of OS lite for raspberry (2022-04-04-raspios-bullseye-armhf-lite.img) the default password is not defined. As the fastest and dummy way, I flashed a version from 2021-05-07 (2021-05-07-raspios-buster-armhf-lite). In this version, the password is defined as "raspberry". This solved my access problem ;)

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Setting the SSH password with Pi Imager is not working for me

Thu Apr 21, 2022 9:54 pm

AlessandroHDO wrote:
Thu Apr 21, 2022 9:12 pm
I had the same issue. When I inserted the password, It gave me "Access denied". :evil:
I found out that in the last version of OS lite for raspberry (2022-04-04-raspios-bullseye-armhf-lite.img) the default password is not defined. As the fastest and dummy way, I flashed a version from 2021-05-07 (2021-05-07-raspios-buster-armhf-lite). In this version, the password is defined as "raspberry". This solved my access problem ;)

If your goal is run an obsolete version of Raspberry Pi OS, congratulations, you accomplished it.

User avatar
HawaiianPi
Posts: 7749
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Setting the SSH password with Pi Imager is not working for me

Fri Apr 22, 2022 2:38 am

zapp7 wrote:
Mon Apr 18, 2022 9:21 pm
Using Pi Imager 1.7.2 to install Raspbian Lite 32 bit on an SD card. I click the cog and enable SSH, set my username and password, then write to the card.
I have done the same and it works fine for me (and by the way, it's Raspberry Pi OS, not Raspbian).

Do you also need to change location settings (perhaps an input error due to keyboard layout)?

zapp7 wrote:
Mon Apr 18, 2022 9:21 pm
On a side note, I really miss the default pi/raspberry login right now...
Did you try setting that with Raspberry Pi Imager?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

bozzuul
Posts: 1
Joined: Fri May 20, 2022 6:14 pm
Location: nl

Re: Setting the SSH password with Pi Imager is not working for me

Fri May 20, 2022 6:19 pm

Thanks, this is the perfect solution for HEADLESS systems.....

User avatar
HawaiianPi
Posts: 7749
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Setting the SSH password with Pi Imager is not working for me

Sat May 21, 2022 11:48 pm

bozzuul wrote:
Fri May 20, 2022 6:19 pm
Thanks, this is the perfect solution for HEADLESS systems.....
The solution for headless systems was covered in a news article when the April images were released.
https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

User avatar
jahboater
Posts: 8694
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Setting the SSH password with Pi Imager is not working for me

Sun May 22, 2022 2:48 am

bozzuul wrote:
Fri May 20, 2022 6:19 pm
Thanks, this is the perfect solution for HEADLESS systems.....
Also see the helpful post by RonR earlier in this thread to create the user pi with the old default password:
1. Write 2022-04-04-raspios-bullseye-armhf-lite.img to an SD card using Etcher.

2. Create a file named user userconf (or userconf.txt) containing the following:

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
3. Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.

4. Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.

dloranger
Posts: 53
Joined: Wed Nov 02, 2016 1:56 am
Location: Seattle

Re: Setting the SSH password with Pi Imager is not working for me

Wed Jun 01, 2022 10:41 pm

so I have tried this with the imager as well as the config file using the lite image, no luck.

any ideas what is going wrong?

all I get is the following when trying to log in

login as: root
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
Attachments
Capture.PNG
Capture.PNG (22.99 KiB) Viewed 15805 times
Capture.PNG
Capture.PNG (19.14 KiB) Viewed 15805 times
Capture.PNG
Capture.PNG (20.03 KiB) Viewed 15805 times

bls
Posts: 2970
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Setting the SSH password with Pi Imager is not working for me

Wed Jun 01, 2022 11:02 pm

RonR wrote:
Thu Apr 21, 2022 9:54 pm
AlessandroHDO wrote:
Thu Apr 21, 2022 9:12 pm
I had the same issue. When I inserted the password, It gave me "Access denied". :evil:
I found out that in the last version of OS lite for raspberry (2022-04-04-raspios-bullseye-armhf-lite.img) the default password is not defined. As the fastest and dummy way, I flashed a version from 2021-05-07 (2021-05-07-raspios-buster-armhf-lite). In this version, the password is defined as "raspberry". This solved my access problem ;)

If your goal is run an obsolete version of Raspberry Pi OS, congratulations, you accomplished it.
But to be fair, an 'apt update && apt full-upgrade' will bring all the installed packages up to date, so it's not horribly obsolete.

That said, it's best practice to move forward with the latest/greatest images when building new systems.
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Setting the SSH password with Pi Imager is not working for me

Wed Jun 01, 2022 11:04 pm

dloranger wrote:
Wed Jun 01, 2022 10:41 pm
any ideas what is going wrong?

I don't believe the RPi Imager supports logging in as root instead of a normal user.

Also, root login is disabled by default.

You must enable root login in '/etc/ssh/sshd_config' by changing:

Code: Select all

#PermitRootLogin prohibit-password
to

Code: Select all

PermitRootLogin yes
You must restart ssh following this change:

Code: Select all

systemctl restart ssh

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Setting the SSH password with Pi Imager is not working for me

Wed Jun 01, 2022 11:06 pm

bls wrote:
Wed Jun 01, 2022 11:02 pm
But to be fair, an 'apt update && apt full-upgrade' will bring all the installed packages up to date, so it's not horribly obsolete.

Not true. Buster is only receiving security updates at this time.

bls
Posts: 2970
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Setting the SSH password with Pi Imager is not working for me

Wed Jun 01, 2022 11:15 pm

RonR wrote:
Wed Jun 01, 2022 11:06 pm
bls wrote:
Wed Jun 01, 2022 11:02 pm
But to be fair, an 'apt update && apt full-upgrade' will bring all the installed packages up to date, so it's not horribly obsolete.

Not true. Buster is only receiving security updates at this time.
I agree with you in spirit, but it IS receiving security updates, therefore not totally obsolete. It is deprecated, and eventually WILL become obsolete, but right now it's teetering on the brink.
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

dloranger
Posts: 53
Joined: Wed Nov 02, 2016 1:56 am
Location: Seattle

Re: Setting the SSH password with Pi Imager is not working for me

Thu Jun 02, 2022 4:20 pm

RonR wrote:
Wed Jun 01, 2022 11:04 pm
dloranger wrote:
Wed Jun 01, 2022 10:41 pm
any ideas what is going wrong?

I don't believe the RPi Imager supports logging in as root instead of a normal user.

Also, root login is disabled by default.

You must enable root login in '/etc/ssh/sshd_config' by changing:

Code: Select all

#PermitRootLogin prohibit-password
to

Code: Select all

PermitRootLogin yes
You must restart ssh following this change:

Code: Select all

systemctl restart ssh


Thanks for getting back to me, I figured that might be the case, was hoping with the new mechanisms they would have removed that extra work. Rebuilding from scratch again with the pi user and will see how that goes

bls
Posts: 2970
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Setting the SSH password with Pi Imager is not working for me

Fri Jun 03, 2022 5:24 pm

dloranger wrote:
Thu Jun 02, 2022 4:20 pm

Thanks for getting back to me, I figured that might be the case, was hoping with the new mechanisms they would have removed that extra work. Rebuilding from scratch again with the pi user and will see how that goes
When you get tired of spending too much time rebuilding your system, have a look at sdm. You can rebuild your system EXACTLY the way you want it with practically zero effort in 15-20 minutes on a Pi4 (slower Pis obviously take longer).
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

kini
Posts: 9
Joined: Sat Aug 20, 2016 1:00 pm

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 9:38 pm

RonR wrote:
Tue Apr 19, 2022 2:22 am
Give this a try:

1. Write 2022-04-04-raspios-bullseye-armhf-lite.img to an SD card using Etcher.

2. Create a file named user userconf (or userconf.txt) containing the following:

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
3. Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.

4. Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.



Hi, I've tried to use your example to log in to my raspberry pi but it doesn't work. When I try to log in after I've copied

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
into userconf.txt (I've tried userconf too) file it just returns access denied same as without the usercomf file. Is this still supported?

User avatar
butchkemper
Posts: 160
Joined: Sat Jul 22, 2017 8:03 pm
Location: Sachse, Tx. Dallas is a nearby suburb of Sachse.

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 10:15 pm

dloranger wrote:
Wed Jun 01, 2022 10:41 pm
so I have tried this with the imager as well as the config file using the lite image, no luck.

any ideas what is going wrong?

all I get is the following when trying to log in

login as: root
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
Access denied
root@OpenRepeater's password:
The config file method establishes the userid "pi" with the password "raspberry" and you are trying to login with the userid "root".

Butch

User avatar
butchkemper
Posts: 160
Joined: Sat Jul 22, 2017 8:03 pm
Location: Sachse, Tx. Dallas is a nearby suburb of Sachse.

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 10:19 pm

kini wrote:
Fri Sep 02, 2022 9:38 pm
RonR wrote:
Tue Apr 19, 2022 2:22 am
Give this a try:

1. Write 2022-04-04-raspios-bullseye-armhf-lite.img to an SD card using Etcher.

2. Create a file named user userconf (or userconf.txt) containing the following:

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
3. Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.

4. Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.



Hi, I've tried to use your example to log in to my raspberry pi but it doesn't work. When I try to log in after I've copied

Code: Select all

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
into userconf.txt (I've tried userconf too) file it just returns access denied same as without the usercomf file. Is this still supported?
You need to login with the userid "pi" and the password "raspberry" because that is what the userconf file sets.

Butch

kini
Posts: 9
Joined: Sat Aug 20, 2016 1:00 pm

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 10:23 pm

butchkemper wrote:
Fri Sep 02, 2022 10:19 pm
You need to login with the userid "pi" and the password "raspberry" because that is what the userconf file sets.
Yes, I know that. I've tried to log in with username pi and password raspberry. I don't know why you think I've tried it with username root.

User avatar
HawaiianPi
Posts: 7749
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 11:19 pm

kini wrote:
Fri Sep 02, 2022 10:23 pm
Yes, I know that. I've tried to log in with username pi and password raspberry.
Using Raspberry Pi Imager's Advanced options, or manually configuring the old way, with the addition of a userconf file, works for myself and most others.

If it isn't working for you, then either you have done something wrong, or have omitted a step.

Tell us EXACTLY what you did, step by step, from card creation to login failure (leave nothing out).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

kini
Posts: 9
Joined: Sat Aug 20, 2016 1:00 pm

Re: Setting the SSH password with Pi Imager is not working for me

Fri Sep 02, 2022 11:30 pm

Ok, I've installed the Raspberry PI OS via the Raspberry Pi Imager by selecting the OS , the SD card and then I clicked on write. When it finished I've put ssh.txt and userconf.txt (with the username and password) file into the boot directory. Then I've inserted the SD card into the Raspberry Pi and turned it on. When I've tried to log in via Putty it responded with Access denied message.

User avatar
HawaiianPi
Posts: 7749
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Setting the SSH password with Pi Imager is not working for me

Sat Sep 03, 2022 12:23 am

I just tested this procedure again buy writing 2022-04-04-raspios-bullseye-armhf-lite.img.xz to an SD card with Etcher, then adding the 'ssh' and 'userconf' files (with the username and hashed password from RonR's post above), along with wpa_supplicant.conf (for my wireless network).

All of those files were put on the small FAT32 "boot" partition of the card. Then I safely ejected the card and used it to boot one of my Raspberry Pi computers, and after waiting for it to boot, I was able to SSH login as the pi user with the password raspberry.

So what aren't you telling us (I asked you not to leave anything out)?

For example, what model of Pi is it, and how is it connected to your network?
What kind of network is it?
What else is connected to your Pi?
What are you using for a power supply?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

kini
Posts: 9
Joined: Sat Aug 20, 2016 1:00 pm

Re: Setting the SSH password with Pi Imager is not working for me

Thu Sep 08, 2022 11:24 am

I'm using Raspberry Pi 2B+ with an original power adapter (it was included in the box). It is connected to 1000 Gb/s LAN network and there is nothing else connected to the Pi.

drgeoff
Posts: 13595
Joined: Wed Jan 25, 2012 6:39 pm

Re: Setting the SSH password with Pi Imager is not working for me

Thu Sep 08, 2022 11:54 am

kini wrote:
Thu Sep 08, 2022 11:24 am
I'm using Raspberry Pi 2B+
There is not and never has been such model of RPi. If you cannot get that right, what else are you not doing correctly?

Use RPi Imager to preload the username and password as in someone's screen grab above. (But don't use root as the username name.)
Quis custodiet ipsos custodes?

User avatar
B.Goode
Posts: 14831
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Setting the SSH password with Pi Imager is not working for me

Thu Sep 08, 2022 12:51 pm

kini wrote:
Fri Sep 02, 2022 11:30 pm
Ok, I've installed the Raspberry PI OS via the Raspberry Pi Imager by selecting the OS , the SD card and then I clicked on write. When it finished I've put ssh.txt and userconf.txt (with the username and password) file into the boot directory. Then I've inserted the SD card into the Raspberry Pi and turned it on. When I've tried to log in via Putty it responded with Access denied message.


Requests for clarity seem to be continually needed...

When I've tried to log in via Putty

How did you know what host or target to specify for PuTTY to connect to? Did the username you configured for PuTTY match the one in userconf.txt?

Return to “Troubleshooting”