I recently received a Pi Zero W, and I am attempting to set it up for the first time. I loaded a recent download of Raspbian Buster Lite, modified config.txt
with "dtoverlay=dwc2" and cmdline.txt
with "modules-load=dwc2,g_ether" immediately following "rootwait", and added the "ssh" file under the root (boot) directory boot partition.
When I attach the Pi to my Windows 10 machine and attempt to access via SSH, I get "Permission denied (publickey).", and I am never prompted for a password.
Here is the verbose output:
ssh [email protected] -v
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug1: Connecting to raspberry.local [23.195.69.106] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\****/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to raspberry.local:22 as 'pi'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
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: Server host key: ecdsa-sha2-nistp256 SHA256:vJkEyeJnZ7+WydeLYQ3Dccr2JX8qHeoqV/DBovS5dQ4
debug1: Host 'raspberry.local' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\****/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\****/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\****/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\****/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\****/.ssh/id_ed25519
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).
I have also tried with other SSH clients with similar results.
This issue most closely resembles having password authentication disabled, but I find it unlikely that enabling Ethernet over USB would cause that, with that being the only difference between this instance and the other Pis that I successfully set up immediately prior.
I have looked at other tutorials and questions, but the ones I have found deal with not being able to connect to the Pi or are related to administration issues. Based on the tutorials I have seen, it seems that SSH should request a password by default, but that does not occur in this case.
Unfortunately, SSH over USB is currently the only readily available way I have to interface with the Pi, so I am hoping that any solution can be handled by accessing the boot volume.
Let me know if there is any other information that would be helpful to look at.
Edit
After looking at other potential issues, I realized that I was using the incorrect hostname. It seems that invalid hostnames are forwarded to some other target. Now knowing that the correct hostname should be raspberrypi raspberrypi.local
(I tried this initially, but forgot after some time), I have tried with the same result, suggesting that the Pi is not being found. I was initially able to ping the Pi, but I can no longer do that. I will keep debugging and later add my findings here.
Edit 2 It turns out that my Bonjour installation was corrupted, so the .local hostname was not being properly resolved. After uninstalling Bonjour and installing iTunes, I am now able to properly connect to the Pi.
raspberrypi.local
as a hostname instead of just raspberrypi?