Sujet : Re: Can't get into headless pi, password not 'raspberry'
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.sys.raspberry-piDate : 26. Jan 2025, 10:57:58
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vn50v6$3k0li$11@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 26/01/2025 09:47, Chris Green wrote:
The Natural Philosopher <tnp@invalid.invalid> wrote:
On 25/01/2025 22:34, Chris Green wrote:
I am trying to set up a new, headless Pi 4B. I have copied the 'lite'
image to a USB drive and created the empty 'ssh' file in the boot
partition.
>
It boots OK and the ssh deamon is running but the default username
'pi' and password 'raspberry' don't work. How on earth do I get into
it to start it up?
>
I can edit files on the USB drive OK so I can add and modify entries
in /etc/passwd and /etc/shadow. So all I actually need to do is set it
up so the user 'pi' has no password but I'm not doing too well at
doing that at the moment.
>
Any ideas, or other ways to get into it?
>
>
Others have told you how to use the imager, but IIRC all that does is
set up a file in the VFAT partition....
>
Here is a shameless cut'n paste
>
Write the Raspberry Pi OS image to your SD card as normal
Mount the newly written /boot partition on the Pi on your computer
Create an empty file named ssh, without a file type / ending. On
Linux and macOS, this is easily done with touch ssh if you’re in the
right directory. This tells the OS to enable SSH access right away.
Next, create a user with a password on the SD card as that’s not
done automatically anymore.
Create an encrypted password for your new Raspberry Pi user. On
Linux and macOS, this can be done with OpenSSL. For added security,
write the new password into a masked shell variable so it doesn’t show
up in your computer’s shell history:
>
[morph@void ~]$ read -s pw
[morph@void ~]$ echo "$pw" | openssl passwd -6 -stdin
>
$6$4E2z6hQOGLZCK5ZN$ESo2r/tO7Sy1Xmyp/bFzQ0A8zNNMhOoj0XocoGVbc8PVLcHlDr/kQiRvv/vOfdopLkylTVQSfK4n97SR9VGGF1
>
>
the long random string is your encrypted password. Next, create
another file next to the ssh file on the SD card’s boot partition named
userconf.txt.
Open userconf.txt with your favourite text editor and in the
first and only line enter your desired username and the encrypted
password, separated by a colon. It should look like this:
morph:$6$4E2z6hQOGLZCK5ZN$ESo2r/tO7Sy1Xmyp/bFzQ0A8zNNMhOoj0XocoGVbc8PVLcHlDr/kQiRvv/vOfdopLkylTVQSfK4n97SR9VGGF1
>
>
And that’s it. Unmount your card, pop it into the Pi, connect it to your
network and boot. You should now be able to SSH into it using your new
credentials. No monitor needed.
>
I think an ssh key will be easier! :-)
I didn't find it so.
Essentially you need to create a file userconf.txt with one line
user:<encrypted password>
in the root of the VFAT boot partition
And if you have a linux system already, you can cut and paste it out of your own /etc/shadow
Plus an empty file called ssh. Using 'touch ssh'
Hardly rocket science
-- Climate is what you expect but weather is what you get.Mark Twain
Date | Sujet | # | | Auteur |
25 Jan 25 | Can't get into headless pi, password not 'raspberry' | 26 | | Chris Green |
26 Jan 25 |  Re: Can't get into headless pi, password not 'raspberry' | 5 | | Chris Townley |
26 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 1 | | Chris Green |
26 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 3 | | Andy Burns |
26 Jan 25 |    Re: Can't get into headless pi, password not 'raspberry' | 1 | | The Natural Philosopher |
26 Jan 25 |    Re: Can't get into headless pi, password not 'raspberry' | 1 | | Chris Townley |
26 Jan 25 |  Re: Can't get into headless pi, password not 'raspberry' | 2 | | Pancho |
26 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 1 | | Chris Green |
26 Jan 25 |  Re: Can't get into headless pi, password not 'raspberry' | 1 | | bp |
26 Jan 25 |  Re: Can't get into headless pi, password not 'raspberry' | 8 | | Lawrence D'Oliveiro |
26 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 7 | | Bob Latham |
26 Jan 25 |    Re: Can't get into headless pi, password not 'raspberry' | 6 | | Chris Green |
26 Jan 25 |     Re: Can't get into headless pi, password not 'raspberry' | 1 | | Chris Green |
26 Jan 25 |     Re: Can't get into headless pi, password not 'raspberry' | 4 | | Bob Latham |
26 Jan 25 |      Re: Can't get into headless pi, password not 'raspberry' | 1 | | The Natural Philosopher |
27 Jan 25 |      Re: Can't get into headless pi, password not 'raspberry' | 2 | | Lawrence D'Oliveiro |
26 Jan 25 |       Re: Can't get into headle | 1 | | Mike Powell |
26 Jan 25 |  Re: Can't get into headless pi, password not 'raspberry' | 5 | | The Natural Philosopher |
26 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 3 | | Chris Green |
26 Jan 25 |    Re: Can't get into headless pi, password not 'raspberry' | 2 | | The Natural Philosopher |
26 Jan 25 |     Re: Can't get into headless pi, password not 'raspberry' | 1 | | Chris Green |
27 Jan 25 |   Re: Can't get into headless pi, password not 'raspberry' | 1 | | Lawrence D'Oliveiro |
26 Feb 25 |  Can't get into headless pi, passwor | 3 | | Dave Vandermeer |
2 Mar 25 |   Re: Can't get into headless pi, passwor | 2 | | The Natural Philosopher |
13 Mar23:16 |    Re: Can't get into headless pi, password not 'raspberry' | 1 | | Lawrence D'Oliveiro |
26 Feb 25 |  Can't get into headless pi, passwor | 1 | | Dave Vandermeer |