Skip to content

Commit 08cba06

Browse files
Updated docs/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md with steps to verify local ssh permissions. Changes only include additions; nothing removed.
1 parent ad3b2a0 commit 08cba06

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,110 @@ If you don't see your public key in {% data variables.product.github %}, you'll
246246

247247
> [!WARNING]
248248
> 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).
249+
250+
251+
## Verify local SSH permissions
252+
253+
{% mac %}
254+
255+
1. Open Terminal.
256+
1. Start SSH agent in the background.
257+
258+
```shell
259+
$ eval "$(ssh-agent -s)"
260+
> Agent pid 59566 # Example output
261+
```
262+
263+
1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this.
264+
265+
```shell
266+
$ ssh-add ~/ssh-directory/<keyfile>
267+
> Permissions 0604 for '/ssh-directory/<keyfile>' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.
268+
```
269+
270+
1. This may be fixed with the `chmod` command.
271+
272+
```shell
273+
$ chmod 700 /ssh-directory
274+
$ chmod 600 /ssh-directory/*
275+
$ chmod 644 /ssh-directory/*.pub
276+
```
277+
278+
1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success.
279+
280+
```shell
281+
$ ssh-add ~/ssh-directory/<keyfile>
282+
> Identity added: /ssh-directory/keyfile (username@hostname)
283+
```
284+
285+
{% endmac %}
286+
287+
{% windows %}
288+
289+
1. Open Terminal.
290+
1. Start SSH agent in the background.
291+
292+
```shell
293+
$ eval "$(ssh-agent -s)"
294+
> Agent pid 59566 # Example output
295+
```
296+
297+
1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this.
298+
299+
```shell
300+
$ ssh-add ~/ssh-directory/<keyfile>
301+
> Permissions 0604 for '/ssh-directory/<keyfile>' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.
302+
```
303+
304+
1. This may be fixed with the `chmod` command.
305+
306+
```shell
307+
$ chmod 700 /ssh-directory
308+
$ chmod 600 /ssh-directory/*
309+
$ chmod 644 /ssh-directory/*.pub
310+
```
311+
312+
1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success.
313+
314+
```shell
315+
$ ssh-add ~/ssh-directory/<keyfile>
316+
> Identity added: /ssh-directory/keyfile (username@hostname)
317+
```
318+
319+
{% endwindows %}
320+
321+
{% linux %}
322+
323+
1. Open Terminal.
324+
1. Start SSH agent in the background.
325+
326+
```shell
327+
$ eval "$(ssh-agent -s)"
328+
> Agent pid 59566 # Example output
329+
```
330+
331+
1. Reattempt to add the appropriate SSH key to the authentication agent. If there is a problem with permissions, the return will specify this.
332+
333+
```shell
334+
$ ssh-add ~/ssh-directory/<keyfile>
335+
> Permissions 0604 for '/ssh-directory/<keyfile>' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.
336+
```
337+
338+
1. This may be fixed with the `chmod` command.
339+
340+
```shell
341+
$ chmod 700 /ssh-directory
342+
$ chmod 600 /ssh-directory/*
343+
$ chmod 644 /ssh-directory/*.pub
344+
```
345+
346+
1. After setting permissions, reattempt to add the keyfile. An `Identity added` message indicates success.
347+
348+
```shell
349+
$ ssh-add ~/ssh-directory/<keyfile>
350+
> Identity added: /ssh-directory/keyfile (username@hostname)
351+
```
352+
353+
{% endlinux %}
354+
355+
The GitHub operation may be reattempted.

0 commit comments

Comments
 (0)