I have two SSH keys 'personal' and 'work'.
With them I need to connect to a service: user@service.com.
The keys are linked to two accounts on service.com, however in SSH they both have to use the same user 'user'. Thus I can't use ~/.ssh/config and 'Host's to route the two keys to the correct accounts. As a result, I put the 'work' key into ~/.ssh/config using Host, and comment it out when wanting to do stuff with my 'personal' key.
My question is, is there a better way to handle this?
When I interact with that service, I will source somefile.sh anyway so having some environment variable in there to handle the routing would be ideal, but I can't find a way to change, for example, the ssh config file path, using environment variables.
I don't use ssh directly but rather through a 3rd party tool.
Is there such a variable?
I'm on Linux (Ubuntu).