I need to connect to various servers in my personal environment, and each server requires its own key. However, how can I identify these keys so that my terminal uses the correct one?
The variant with:
Host *
IdentitiesOnly Yes
IdentityAgent /Users/me/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
Host example.com
IdentityFile /Users/me/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ertzuiolk4jhez7d89o.pub
IdentitiesOnly yes
User jonathan
HostName example.com
Host example2.com
IdentityFile /Users/me/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ertzuidfgrhez7d89o.pub
IdentitiesOnly yes
User jonathan
HostName example2.com
does not work.
Load key "/Users/me/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/ertzuiolk4jhez7d89o.pub": invalid format
jonathan@example.com: Permission denied (publickey).
It is also logical that the .pub file, which only contains the public key, does not contain a link to the private key.
I need to connect to various servers in my personal environment, and each server requires its own key. However, how can I identify these keys so that my terminal uses the correct one?
The variant with:
does not work.
It is also logical that the .pub file, which only contains the public key, does not contain a link to the private key.
How does this work?