Skip to content

[bug]: Remote SSH to LAN hosts fails with EHOSTUNREACH — missing NSLocalNetworkUsageDescription in Info.plist #2984

Description

@houllette

Bug Description

Connecting a remote project to an SSH host on the local subnet fails
immediately with EHOSTUNREACH. The same host connects fine from a
terminal.

The cause is macOS Local Network Privacy. Emdash's Info.plist is missing
NSLocalNetworkUsageDescription, so macOS blocks the connection but has
no usage string to build a consent prompt from. The result is that Emdash
never appears in System Settings → Privacy & Security → Local Network,
so there is no toggle to enable and no way for the user to fix it.

The bundle currently sets NSAllowsLocalNetworking, which is an App
Transport Security key for relaxing HTTPS requirements on local hostnames.
It does not grant the Local Network privacy permission.

$ plutil -p /Applications/Emdash.app/Contents/Info.plist | grep -i localnetwork
"NSAllowsLocalNetworking" => true

This breaks remote development for any host on the user's LAN. Remotes
reachable over the public internet are unaffected, which likely masked it.

Same root cause as anthropics/claude-code#27828.

Steps to Reproduce

  1. On macOS, have an SSH server on a machine on the same subnet
    (e.g. 10.7.1.68, reachable via ssh root@10.7.1.68 from Terminal).
  2. In Emdash, go to Settings → Connections and add an SSH connection
    to that host (or select the alias from the ~/.ssh/config dropdown).
  3. Click Test Connection.
  4. Observe the failure.
  5. Open System Settings → Privacy & Security → Local Network.
    Emdash is not listed, and there is no way to add it.

Actual vs Expected Behavior

Actual

Custom crypto binding not available
Local ident: 'SSH-2.0-ssh2js1.17.0'
Client: Trying 10.7.1.68 on port 22 ...
Socket error: connect EHOSTUNREACH 10.7.1.68:22 - Local (10.7.1.61:50496)

The TCP connect never completes. macOS logs the block:

$ sudo log stream --predicate 'eventMessage CONTAINS[c] "local network"' --info
UserEventAgent: (com.apple.networkextension) Got local network blocked
notification: pid: 9164, uuid: 4C4C4426-5555-3144-A164-8BF7EAB320E6,
bundle_id: (null)

The null bundle_id is why no entry is ever created in System Settings.

The same host connects fine from Ghostty, which does have Local Network
permission:

$ ssh -v root@10.7.1.68     # succeeds

Expected

macOS prompts for Local Network access on first attempt, Emdash appears
in the Local Network list, and the SSH connection succeeds.

emdash Version

v1.1.40

Operating System

macOS 27.0

Additional Context

Fix

Add the usage description to the electron-builder mac config:

"mac": {
  "extendInfo": {
    "NSLocalNetworkUsageDescription": "Emdash needs local network access to connect to SSH hosts on your network."
  }
}

Ruled out during debugging

  • Code signature is valid and notarized:
    spctl -a -vv returns accepted, source=Notarized Developer ID,
    Developer ID Application: Arne Strickmann (2AZ6648627)
  • App is running from /Applications, not a symlink or mounted DMG
  • LaunchServices re-registration (lsregister -f -R -trusted) made no difference
  • Network/routing is fine — same host reachable from other apps on the
    same machine

Workaround

Adding a Port 443 listener to sshd on the remote host and pointing
Emdash at :443 works, since macOS exempts ports 80 and 443 from the
Local Network check.

Possibly related

Some reports on Apple's developer forums describe apps that set
NSLocalNetworkUsageDescription correctly and still fail to appear in the
Local Network list. The missing key is clearly the first-order bug here,
but it may be worth verifying the fix on a clean macOS user account
(Local Network state is per-user).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions