Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Last active February 28, 2026 06:48
Show Gist options
  • Select an option

  • Save ManotLuijiu/7d8aa5ef75a76ad7f01b0914e030c80e to your computer and use it in GitHub Desktop.

Select an option

Save ManotLuijiu/7d8aa5ef75a76ad7f01b0914e030c80e to your computer and use it in GitHub Desktop.
Connect to Host (Remote Server via SSH)
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
Host {human_readable_name}
HostName {remote_server_ip}
User {Ubuntu_server_user}
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
@ManotLuijiu
Copy link
Author

ManotLuijiu commented Feb 28, 2026

VS Code Remote-SSH keeps asking for password despite id_ed25519.pub being registered in the server's ~/.ssh/authorized_keys.

macOS SSH agent loses keys after reboot. Even if the key exists on disk, the agent has no identities loaded:

ssh-add -l
# The agent has no identities.

Fix (on macOS / iMac side)

Step 1: Add key to agent

ssh-add ~/.ssh/id_ed25519
# Press Enter for passphrase (blank if none was set — terminal shows nothing, that's normal)

Step 2: Persist across reboots (macOS-specific)

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment