I am working with multiple SSH private keys to connect to different servers or services (e.g., system administration, Git usage) on the same machine. Currently, I am using the -i option like so:
Apparently a straightforward way to do this is to use the command
ssh -i <path_to_private_key> [email protected]
However, managing connections this way feels cumbersome, especially when switching between different keys for different servers.
Is there a more efficient way to manage and use multiple SSH private keys without specifying the -i flag each time? I am looking for a configuration or tool-based approach that allows me to streamline this process.
What I've tried: Stacking the keys in the id_rsa file, which didn't work. Manually specifying the private key file with the -i flag, but this approach isn't very scalable.
Desired outcome: I'd like to set up my SSH configuration so that the correct private key is automatically used for the corresponding server or service.