Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 1.64 KB

error-ssh-add-illegal-option----apple-use-keychain.md

File metadata and controls

36 lines (30 loc) · 1.64 KB
title intro redirect_from versions topics shortTitle
Error: ssh-add: illegal option -- apple-use-keychain
This error means your version of `ssh-add` does not support macOS keychain integration, which allows you to store your passphrase in the keychain.
/articles/error-ssh-add-illegal-option-k
/articles/error-ssh-add-illegal-option----k
/github/authenticating-to-github/error-ssh-add-illegal-option----k
/github/authenticating-to-github/troubleshooting-ssh/error-ssh-add-illegal-option----k
/authentication/troubleshooting-ssh/error-ssh-add-illegal-option----k
fpt ghes ghec
*
*
*
SSH
ssh-add "illegal option" error

The --apple-use-keychain option is in Apple's standard version of ssh-add, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent. If you have installed a different version of ssh-add, it may lack support for --apple-use-keychain.

Solving the issue

To add your SSH private key to the ssh-agent, you can specify the path to the Apple version of ssh-add:

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

Note

  • The --apple-use-keychain option is in Apple's standard version of ssh-add. In macOS versions prior to Monterey (12.0), use -K instead of --apple-use-keychain.
  • {% data reusables.ssh.add-ssh-key-to-ssh-agent %}

Further reading