I am trying to set up a headless raspberry pi 4 so that I can ssh into it via my computer. To set it up, I did the following:
- Erased the microSD via disk utility
- BalenaEtched raspberry pi OS from raspberry pi website onto the microSD
- Safely eject microSD from comp
- Insert into raspberry pi 4, connect power
- Wait for raspberry pi IP to show up on ip scanner (interestingly, always fails upon first open, causing me to quit and restart ip scanner)
- Ping the IP address... receive successful pings
- Attempt
ssh pi@<ip address>
- Get error 'port 22: connection refused'
- Turn off raspberry pi
- Unplug microSD from pi, reconnect to computer
- Navigate to microSD and touch empty 'ssh' file at root directory; my understanding is that this should enable ssh to be set up on boot
- Verify ssh file exists
- Eject via
diskutil eject /dev/diskX
- Insert into raspberry pi
- Repeat steps 4-7
- Receive following error:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ED25519 key sent by the remote host is SHA256:<string>. Please contact your system administrator. Add correct host key in /Users/<username>/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /Users/<username>/.ssh/known_hosts:1 Host key for <piipaddress> has changed and you have requested strict checking. Host key verification failed.
- Delete the line from my known_hosts file at `~/.ssh/known_host
- Attempt again to
ssh pi@<ip address>
- Receive following warning:
The authenticity of host '<ip address> (<ip address>)' can't be established. ED25519 key fingerprint is SHA256:<string>. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])?
- Assume this is referring to my creation of the ssh file in microSD, say 'yes'
- Receive following warning:
Warning: Permanently added '<ip address>' (ED25519) to the list of known hosts. Please note that SSH may not work until a valid user has been set up.See http://rptl.io/newuser for details. pi@<ip address>'s password:
- Input 'raspberry' as the password
- Get
permission denied, please try again
error
No idea what I am doing wrong here.
2 Answers 2
Most of what you have done is unnecessary but should work however current Raspberry Pi OS DO NOT have a default user nor ssh enabled. The current setup process is different.
You need to boot the Pi and create a user then enable ssh.
If you really want to setup headless you need to use the RaspberryPi Imager and follow the instructions to configure a user & ssh.
-
I assumed that by this you meant clicking the gear icon in the piimager and configuring the ssh account there? If so, is it possible to install umbrel node with this set up? Via piiamger with umbrel node download, still configuring the ssh int he same way?Runeaway3– Runeaway32023年08月14日 03:35:16 +00:00Commented Aug 14, 2023 at 3:35
-
Whatever "umbrel node" may be is unclear but detail belongs in your question - not Comments.Milliways– Milliways2023年08月14日 03:40:09 +00:00Commented Aug 14, 2023 at 3:40
As the link http://rptl.io/newuser (redirecting to https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/) provided by your raspberry shows, the Raspberry Pi OS no longer comes with a default user named pi
(much less having a raspberry
pasword). That's why you can't login with that.
You can create the user by booting graphically once, by using the RaspberryPi Imager to create an initial user, or with a file called userconf or userconf.txt in the boot partition of the SD card (likely the easiest path for you).
-
Is it possible to create this
userconf
file remotely, or .. ?Egret– Egret2024年03月30日 00:25:37 +00:00Commented Mar 30, 2024 at 0:25 -
@Egret you can create it by mounting the SD card on another computer. You can't enable it remotely without being able to log in first.Ángel– Ángel2024年04月09日 00:20:14 +00:00Commented Apr 9, 2024 at 0:20
ssh
on macOS to avoid these. You post seems to conflate macOS errors and Pi response.ssh -vvv pi@<ip address>