0

After quite a long time between reboots, I did one.

After rebooting I was working on some code hosted on GitHub, however

> ssh -T [email protected]
[email protected]: Permission denied (publickey).

Now, I have previously followed the steps in Generate new SSH key to generate the SSH key.

However, after rebooting it seems like neither the ssh-agent is started (not present in any startup scripts) nor that the identities are added after starting the ssh-agent.

I'm kind of at a loss of where to start troubleshooting, as I cannot see why ssh doesn't make use of the config in ~/.ssh/config that I have set up.

Note: Booting up the ssh-agent with eval "$(ssh-agent -s)" and adding them using ssh-add --apple-use-keychain <path to private key> seems to work fine. This also works when added to my .bashrc or .zshrc, but if I am not mistaken, this should not be necessary when the ~/.ssh/config is set up.

Any help would be much appreciated

Edit 1: The following is my ~/.ssh/config

Host *.github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/rk_gmail

# Fig ssh integration. Keep at the bottom of this file.
Match all
  Include ~/.fig/ssh
Raoul
  • 1
  • 1
  • This might not be a credentials issue but an SSH protocol issue. It might be a host key issue because the destination server is out of date and only uses older/insecure protocols. This is a known issue and the answer [can be found here](https://superuser.com/a/1749370/167207). – Giacomo1968 Jan 05 '23 at 17:05
  • 2
    Does this answer your question? [Git SSH "permission denied" in macOS 13 Ventura](https://superuser.com/questions/1749364/git-ssh-permission-denied-in-macos-13-ventura) – Giacomo1968 Jan 05 '23 at 17:06
  • Thanks for your responses I've also added the `~/.ssh/config` as an edit to the post @KamilMaciorowski @Giacomo1968, I have taken a look at that post previously yes. As per the GitHub docs I used ed25519 as the encryption algorithm. – Raoul Jan 05 '23 at 20:09
  • 1
    After following the github guide for [generating a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) everything seems to work. That makes it likely that there was a user error on my end. For the next person who comes here, please try following the documentation as written without deviation and see if this solves your problem. – Raoul Jan 16 '23 at 10:30

0 Answers0