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 [] 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.

  • Welcome. Minor point: "under the root (boot) directory." Don't refer to it that way or people will get confused. In context the first partition is the boot fs, the second, the root fs (ie., they aren't the same). Not having a way to access the root partition outside of a running Pi is probably going to continue to be a hassle for you unless everything goes perfectly 100% of the time, so you may want to look into a solution to that problem.
    – goldilocks
    Aug 24, 2019 at 12:28
  • Indeed. Thanks for pointing that out. Working on a Windows machine, I did not realize the root directory was actually accessible until after posting this. Having looked into it, I can now access the root partition via third-party software, so that is no longer a problem.
    – Austin
    Aug 24, 2019 at 20:45
  • 1
    Welcome. I assume you can see the RNDIS among your USB devices in the Windows 10 device manager? If so zeroconf should generally work. Did you try raspberrypi.local as a hostname instead of just raspberrypi?
    – jdonald
    Aug 25, 2019 at 2:56

2 Answers 2


They key is this message

debug1: Authentications that can continue: publickey

The server is configured to accept only publickey authentication.

If you can't connect a display to the Pi and login locally, you can always download a life Linux system and boot it on your PC. Anyway, look at the sshd_config on the SD card and make sure that password authentication is enabled.


This seems to be an edge case, but the root cause was an invalid Bonjour installation, which prevented the raspberrypi.local hostname from being resolved.

This became apparent as all .local hostnames would resolve to my own machine.

As I was unable to get a correct Bonjour installation, my solution was to install iTunes instead.

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.