1
0
mirror of synced 2025-12-22 03:16:52 -05:00
Files
docs/content/authentication/troubleshooting-ssh/error-ssh-add-illegal-option----k.md
Laura Coursen 8f964ea2cb GHEC version (#20947)
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Steve Guntrip <12534592+stevecat@users.noreply.github.com>
Co-authored-by: Robert Sese <sese@github.com>
Co-authored-by: Peter Bengtsson <peterbe@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-10-15 15:41:33 -05:00

1.4 KiB

title, intro, redirect_from, versions, topics, shortTitle
title intro redirect_from versions topics shortTitle
Error: ssh-add: illegal option -- K 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
fpt ghes ghae ghec
* * * *
SSH
ssh-add: illegal option -- K

The -K 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 -K.

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 -K ~/.ssh/id_rsa

{% note %}

Note: {% data reusables.ssh.add-ssh-key-to-ssh-agent %}

{% endnote %}

Further reading