From 28b680fa846371a63224633ff4a3b5694e1f048a Mon Sep 17 00:00:00 2001 From: Michael Lihs Date: Wed, 5 May 2021 23:22:19 +0200 Subject: [PATCH 1/2] add additional information on dealing with ~/.ssh/config errors on Mac Given the many upvotes on this post on StackOverflow https://stackoverflow.com/questions/47455300/ssh-config-bad-configuration-option-usekeychain-on-mac-os-sierra-10-12-6 it seems like many users have an issue with Mac not dealing properly with the `UseKeychain` config in the `~/.ssh/config`. This commit adds additional information on how to fix the problem and allows GitHub users to find a solution in the GitHub documentation when searching for the error message. --- ...ew-ssh-key-and-adding-it-to-the-ssh-agent.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index 9508aac34eaa..f8206100ad41 100644 --- a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -105,6 +105,23 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav **Note:** If you chose not to add a passphrase to your key, you should omit the `UseKeychain` line. {% endnote %} + + {% note %} + + **Note:** If you are on Mac and seeing an error like + + ``` + /Users/USER/.ssh/config: line 16: Bad configuration option: usekeychain + ``` + + you need to add an additional config line to your `Host *` section: + + ``` + Host * + IgnoreUnknown UseKeychain + ``` + + {% endnote %} 3. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} ```shell From 7fc571e0cefaaeac2545b75b393112080d07af9b Mon Sep 17 00:00:00 2001 From: Sarah Edwards Date: Fri, 7 May 2021 15:38:43 -0700 Subject: [PATCH 2/2] Add mac conditional --- ...-ssh-key-and-adding-it-to-the-ssh-agent.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index f8206100ad41..6961a060b42a 100644 --- a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -106,22 +106,24 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav {% endnote %} - {% note %} - - **Note:** If you are on Mac and seeing an error like - - ``` - /Users/USER/.ssh/config: line 16: Bad configuration option: usekeychain - ``` - - you need to add an additional config line to your `Host *` section: - - ``` - Host * - IgnoreUnknown UseKeychain - ``` - - {% endnote %} + {% mac %} + {% note %} + + **Note:** If you see an error like this + + ``` + /Users/USER/.ssh/config: line 16: Bad configuration option: usekeychain + ``` + + add an additional config line to your `Host *` section: + + ``` + Host * + IgnoreUnknown UseKeychain + ``` + + {% endnote %} + {% endmac %} 3. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} ```shell