0

I'm trying to get headless SSH access to a Pi Zero 2 W using a USB cable from my Mac... However the SSH is failing with "Permission denied, please try again.". What am I doing wrong?

These are the steps I'm following:

  1. Flash Raspberry Pi OS Lite 64-bit version (released 2022-04-04) using Pi Imager to SD card
  2. In config.txt, add this as the last line of the file: dtoverlay=dwc2
  3. In cmdline.txt, add this as a parameter, just after the rootwait parameter: modules-load=dwc2,g_ether
  4. Add empty file called ssh
  5. Connect Pi to Mac with USB cable, making sure to connect to USB port on Pi (not PWR)
  6. Boot Pi
  7. Check in Mac System Preferences > Sharing that Internet Sharing and RNDIS/Ethernet Gadget are ticked.
  8. Ping Pi: ping raspberrypi.local, check that it has a 192.168.X.Y address.
  9. Pull the power out while it's pinging, check that it stops (proving that this is definitely our Pi and not another on the network!)
  10. Boot Pi again
  11. Try to SSH to Pi, using password raspberry:
osx~ $ ssh -v [email protected]
OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /Users/dave/.ssh/config
debug1: /Users/dave/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to raspberrypi.local port 22.
debug1: Connection established.
debug1: identity file /Users/dave/.ssh/id_rsa type 0
debug1: identity file /Users/dave/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Debian-5
debug1: compat_banner: match: OpenSSH_8.4p1 Debian-5 pat OpenSSH* compat 0x04000000
debug1: Authenticating to raspberrypi.local:22 as 'pi'
debug1: load_hostkeys: fopen /Users/dave/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:Qs/dlJ7rsKrqH5v0XpxSZhcx1PVA1fGLJ1Fgn7hv86o
debug1: load_hostkeys: fopen /Users/dave/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: hostkeys_find_by_key_hostfile: hostkeys file /Users/dave/.ssh/known_hosts2 does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist
The authenticity of host 'raspberrypi.local (192.168.2.4)' can't be established.
ED25519 key fingerprint is SHA256:Qs/dlJ7rsKrqH5v0XpxSZhcx1PVA1fGLJ1Fgn7hv86o.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'raspberrypi.local' (ED25519) to the list of known hosts.
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/dave/.ssh/id_rsa RSA SHA256:I7UgZAer3VjGf73X801UKYiTB9XRdXesCmls9ev33Kc explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/dave/.ssh/id_rsa RSA SHA256:I7UgZAer3VjGf73X801UKYiTB9XRdXesCmls9ev33Kc explicit
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password: 

1 Answer 1

1

You know the latest Raspberry Pi OS dated 4/4/2022 no longer has a default pi user?

https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/

3
  • 1
    That's definitely the problem!
    – davelondon
    Commented Apr 9, 2022 at 11:44
  • Uh, I don't think 4/4/20 is correct... maybe you meant 4/4/22?? But good catch for finding this! I don't like it, but I'm glad to know it :)
    – Seamus
    Commented Apr 9, 2022 at 21:12
  • I called myself reading the "reveal", but unless I missed it, there are several other adjustments that are going to be required as a result of this. For example, user pi has traditionally been included by default in several groups that give pi the ability to do things (e.g. the bluetooth group) that will no longer be possible until the appropriate adjustments are made. And I assume "password-less" sudo will also need to be restored.
    – Seamus
    Commented Apr 9, 2022 at 21:32

Your Answer

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

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