Skip to content

OrbStack creates directories at ~/.ssh/id_ed25519 instead of ensuring ~/.ssh/ exist #2353

@Vinai

Description

@Vinai

Describe the bug

After every reboot, OrbStack creates empty directories named id_ed25519 and id_ed25519.pub inside ~/.ssh/ with permissions 0755 (drwxr-xr-x@). These should not exist — OrbStack's own SSH keys are correctly stored at ~/.orbstack/ssh/id_ed25519.

This breaks ssh-add because it treats the directory as a key file with too-open permissions:

% ssh-add
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/Users/vinai/.ssh/id_ed25519' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

Evidence that OrbStack is the culprit

Both the bogus ~/.ssh/id_ed25519 directory and OrbStack's legitimate ~/.orbstack/ssh/id_ed25519 key file have identical com.apple.provenance extended attribute values:

% xattr -px com.apple.provenance ~/.ssh/id_ed25519
01 00 00 31 BC 94 3A 1F 30 4C B8

% xattr -px com.apple.provenance ~/.orbstack/ssh/id_ed25519
01 00 00 31 BC 94 3A 1F 30 4C B8

The com.apple.provenance attribute is set by macOS on files/directories created by non-Apple-signed applications. Identical values prove the same application created both.

Likely cause

OrbStack appears to call mkdir -p ~/.ssh/id_ed25519 instead of mkdir -p ~/.ssh/ when ensuring the SSH directory exists. This creates a directory at the key file path instead of just ensuring the parent directory exists.

Environment

  • macOS 26.3.1 (Tahoe)
  • OrbStack 0.x (installed via Homebrew Cask)
  • Apple Silicon (arm64)

Workaround

Generating a real ed25519 keypair at ~/.ssh/id_ed25519 prevents OrbStack from creating the directories (it presumably checks for existence before creating):

rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" -C "placeholder"

However

This prevents orbstack from working correctly. I've now aliased ssh-add without arguments to rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519* && ssh-add && mkdir -p ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.
Not nice, but 🤷
It would be nice if orbstack would find a way to not rely on the bogus key directories to exist.

To Reproduce

Steps to reproduce

  1. Delete the bogus directories: rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
  2. Reboot the Mac (or restart OrbStack)
  3. Observe that ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub are recreated as empty directories

Directory listing

% ls -la ~/.ssh/id_ed25519
drwxr-xr-x@  2 vinai  staff  64  5 Mar 08:37 id_ed25519

% ls -la ~/.ssh/id_ed25519.pub
drwxr-xr-x@  2 vinai  staff  64  5 Mar 08:37 id_ed25519.pub

% file ~/.ssh/id_ed25519
/Users/vinai/.ssh/id_ed25519: directory

Both directories are empty (contain only . and ..).

Expected behavior

Being able to run ssh-add without error.

Diagnostic report (REQUIRED)

OrbStack info:
Version: 2.0.5
Commit: cfe47627f138ffd822c958553b0a93eaf2692c71 (v2.0.5)

System info:
macOS: 26.3.1 (25D2128)
CPU: arm64, 12 cores
CPU model: Apple M2 Max
Model: Mac14,6
Memory: 64 GiB

Full report: https://orbstack.dev/_admin/diag/orbstack-diagreport_2026-03-09T13-07-57.425120Z.zip

Screenshots and additional context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions