1

I'm trying to setup SSH keys on macOS 10.15 using this and this guide.

The only difference is that I'm setting up ssh inside ~/.config/ instead of ~

When I try to test the SSH connection to GitHub using ssh -T git@github.com, I get the below error:

$HOME/.config/ssh/id_rsa: line 1: Bad configuration option: -----begin
......................................................................
...........................PRIVATE KEY................................
......................................................................
$HOME/.config/ssh/id_rsa: line 50: Bad configuration option: -----end
$HOME/.config/ssh/id_rsa: terminating, 50 bad configuration options

Below is the SSH config file (located at ~/.config/ssh/config):

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.config/ssh/id_rsa

How can I resolve this?


Update 1:

I've also tried adding IgnoreUnknown value to the ssh config file, as mentioned in this answer, but still getting the same error.

Output of ssh -vT git@github.com:

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data $HOME/.config/ssh/id_rsa
$HOME/.config/ssh/id_rsa: line 1: Bad configuration option: -----begin
......................................................................
...........................PRIVATE KEY................................
......................................................................
$HOME/.config/ssh/id_rsa: line 50: Bad configuration option: -----end
$HOME/.config/ssh/id_rsa: terminating, 50 bad configuration options
Saurabh
  • 5,176
  • 4
  • 32
  • 46

0 Answers0