You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,62 @@ You should see this output:
45
45
46
46
The connection should be made on port 22{% ifversion fpt or ghec %}, unless you're overriding settings to use [SSH over HTTPS](/authentication/troubleshooting-ssh/using-ssh-over-the-https-port){% endif %}.
47
47
48
+
## Manually specify the SSH key file
49
+
50
+
If you've created an SSH key file following the [GitHub documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent), chances are it was created with the default filename of `id_ed25519/id_ed25519.pub`, or similar. If, however, you chose to use a non-default filename, then the commands to SSH into GitHub to test the connection will fail. This is because, by default and without any additional configuration, SSH will try to connect using default/standardized filenames. This can be seen in the following debug output below:
Transferred: sent 4024, received 4272 bytes, in 0.1 seconds
98
+
Bytes per second: sent 30574.9, received 32459.2
99
+
debug1: Exit status 1
100
+
```
101
+
102
+
This command was issued from within the directory where the private and public key files are stored; this is typically `~/.ssh`, but might be different on your system. Be sure to modify the command to include the relative filepath, if applicable.
103
+
48
104
## Always use the "git" user
49
105
50
106
All connections, including those for remote URLs, must be made as the "git" user. If you try to connect with your {% data variables.product.github %} username, it will fail:
0 commit comments