Adding SSH key to ssh-agent [closed]

The instruction you mention are:

  • for a private key that was passphrase-protected
  • for adding said private key, not ~/.ssh/config: ssh-add ~/.ssh/id_ed25519 or ssh-add ~/.ssh/id_rsa

~/.ssh/config is only needed for non-conventional private key filenames/file path.

For instance:

Host gh
  Hostname github.com
  User git
  IdentityFile ~/path/to/my/private/ky

(the private key can be defined anywhere, with any name)

You would then use the URL gh: ssh -Tv gh

git ls-remote gh:me/myRepo