From 08cba06df9d4a34ab924b09f794bcc98bbf23485 Mon Sep 17 00:00:00 2001 From: rainycitycoder Date: Fri, 21 Nov 2025 13:01:04 -0800 Subject: [PATCH 1/2] Updated docs/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md with steps to verify local ssh permissions. Changes only include additions; nothing removed. --- .../error-permission-denied-publickey.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md index de169cc9cd94..7e5407343f47 100644 --- a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md +++ b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md @@ -246,3 +246,110 @@ If you don't see your public key in {% data variables.product.github %}, you'll > [!WARNING] > If you see an SSH key you're not familiar with on {% data variables.product.github %}, delete it immediately and contact {% data variables.contact.contact_support %} for further help. An unidentified public key may indicate a possible security concern. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys). + + +## Verify local SSH permissions + +{% mac %} + +1. Open Terminal. +1. Start SSH agent in the background. + + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 # Example output + ``` + +1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this. + + ```shell + $ ssh-add ~/ssh-directory/ + > Permissions 0604 for '/ssh-directory/' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. + ``` + +1. This may be fixed with the `chmod` command. + + ```shell + $ chmod 700 /ssh-directory + $ chmod 600 /ssh-directory/* + $ chmod 644 /ssh-directory/*.pub + ``` + +1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success. + + ```shell + $ ssh-add ~/ssh-directory/ + > Identity added: /ssh-directory/keyfile (username@hostname) + ``` + +{% endmac %} + +{% windows %} + +1. Open Terminal. +1. Start SSH agent in the background. + + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 # Example output + ``` + +1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this. + + ```shell + $ ssh-add ~/ssh-directory/ + > Permissions 0604 for '/ssh-directory/' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. + ``` + +1. This may be fixed with the `chmod` command. + + ```shell + $ chmod 700 /ssh-directory + $ chmod 600 /ssh-directory/* + $ chmod 644 /ssh-directory/*.pub + ``` + +1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success. + + ```shell + $ ssh-add ~/ssh-directory/ + > Identity added: /ssh-directory/keyfile (username@hostname) + ``` + +{% endwindows %} + +{% linux %} + +1. Open Terminal. +1. Start SSH agent in the background. + + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 # Example output + ``` + +1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this. + + ```shell + $ ssh-add ~/ssh-directory/ + > Permissions 0604 for '/ssh-directory/' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. + ``` + +1. This may be fixed with the `chmod` command. + + ```shell + $ chmod 700 /ssh-directory + $ chmod 600 /ssh-directory/* + $ chmod 644 /ssh-directory/*.pub + ``` + +1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success. + + ```shell + $ ssh-add ~/ssh-directory/ + > Identity added: /ssh-directory/keyfile (username@hostname) + ``` + +{% endlinux %} + +The GitHub operation may be reattempted. \ No newline at end of file From 89a6016cbe1abccf120c7a7b33c128be67bd41b8 Mon Sep 17 00:00:00 2001 From: rainycitycoder Date: Fri, 21 Nov 2025 17:32:56 -0800 Subject: [PATCH 2/2] Updated docs/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md to be specific about what keyfile is being altered. --- .../error-permission-denied-publickey.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md index 7e5407343f47..b88dcdbeaed0 100644 --- a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md +++ b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md @@ -271,8 +271,8 @@ If you don't see your public key in {% data variables.product.github %}, you'll ```shell $ chmod 700 /ssh-directory - $ chmod 600 /ssh-directory/* - $ chmod 644 /ssh-directory/*.pub + $ chmod 600 /ssh-directory/ + $ chmod 644 /ssh-directory/.pub ``` 1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success. @@ -305,8 +305,8 @@ If you don't see your public key in {% data variables.product.github %}, you'll ```shell $ chmod 700 /ssh-directory - $ chmod 600 /ssh-directory/* - $ chmod 644 /ssh-directory/*.pub + $ chmod 600 /ssh-directory/ + $ chmod 644 /ssh-directory/.pub ``` 1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success. @@ -339,8 +339,8 @@ If you don't see your public key in {% data variables.product.github %}, you'll ```shell $ chmod 700 /ssh-directory - $ chmod 600 /ssh-directory/* - $ chmod 644 /ssh-directory/*.pub + $ chmod 600 /ssh-directory/ + $ chmod 644 /ssh-directory/.pub ``` 1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success.