# Connect to WPE doesn't work when too many SSH keys exist

**URL:** <https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428>\
**Category:** Bugs\
**Tags:** local-connect-wpe\
**Created:** [December 14, 2023, 4:10pm UTC](https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428 "2023-12-14T16:10:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [December 14, 2023, 4:10pm UTC](https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428/1 "2023-12-14T16:10:11Z")

</div>

# Bug Summary

Using Connect to WPE with too many ssh keys in a the ssh-agent prevents Local from establishing a connection to the server.

The Local window will say “Local couldn’t load file list”. The Local log will have lines like:

```json
{"class":"RsyncService","level":"warn","message":"Received disconnect from 35.237.148.8 port 22:2: too many authentication failures\r\nDisconnected from 35.237.148.8 port 22\r\n","thread":"main","timestamp":"2023-12-14T15:45:39.593Z"}
{"class":"RsyncService","level":"warn","message":"rsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(226) [sender=3.1.3]\n","thread":"main","timestamp":"2023-12-14T15:45:39.594Z"}

```

Note the part about: `too many authentication failures`

# Steps to reproduce

The rough steps are:

1. Create a bunch of ssh keys
2. Add them to your ssh-agent
3. Try and use Local Connect

Details for Mac (but the issue is probably on other systems too):

```bash
# create 10 keys and add them to ssh-agent. Just press enter a bunch to use empty passwords for the keys.
for i in {1..10}; do export file="ssh_qa_${i}_id_ed25519"; ssh-keygen -t ed25519 -C "me@qa-ssh.local" -f $file && ssh-add $file; done;
# verify the keys are added to the agent
ssh-add -l
# a bunch of lines like
# 256 SHA256:s0WJ0jyTclj68JzI+ybnUJhHoORlC0VbLcZL5Ft16FY me@qa-ssh.local (ED25519)
# ...

```

As long as you don’t have other keys with names starting with `ssh_qa_`, you can clean up these keys with:

```bash
cd ~/.ssh
rm ssh_qa_*

```

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [December 14, 2023, 4:48pm UTC](https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428/3 "2023-12-14T16:48:28Z")

</div>

A fix is in the works and should be included in a future release of Local!

---

<div class="post-metadata">

**Author:** ![austinwendt](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/austinwendt/32/13912_2.png) [@austinwendt](https://community.localwp.com/u/austinwendt)\
**Post date:** [January 22, 2024, 7:24pm UTC](https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428/4 "2024-01-22T19:24:19Z")

</div>

Hi all - we tracked down the root cause of this bug and have it patched up in our latest release, Local v8.2.1. This is available in Beta now - [Local Beta 8.2.1](https://community.localwp.com/t/local-beta-8-2-1/40978)

Expect to see this rolled out to stable (all users) later this week. Thanks for helping us track this down!

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [January 24, 2024, 7:25am UTC](https://community.localwp.com/t/connect-to-wpe-doesnt-work-when-too-many-ssh-keys-exist/40428/5 "2024-01-24T07:25:12Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
