I am using MacOS and something in my system config keeps telling python's SSHTunnelForwarder to use my default id_rsa file INSTEAD of the file I specify in the configuration below:
>>> from sshtunnel import SSHTunnelForwarder
>>> db_tunnel = SSHTunnelForwarder(
... ssh_host="localhost",
... ssh_username="username",
... ssh_port=1111,
... ssh_pkey="~/.ssh/test",
... remote_bind_address=("my-remote-database-domain", 3306)
... )
Gives me this error message:
2022-03-23 13:15:35,715| ERROR | Password is required for key /Users/me/.ssh/id_rsa
Where can I edit the config to override this search for the wrong key?
My ~/.ssh/config:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/test
And yes, I have run ssh-add ~/.ssh/test to add this key.
What else could be confusing it?