I have a couple of ssh clients that I want to automatically set up a ssh-tunnel to a server. To this end I am using cron and sshpass. Depending on the history of the server it may for example expect a response to
user@server's password:
Enter passphrase for key '/home/he/.ssh/id_rsa':
or Enter passphrase for key '/home/he/id_ed25519':
This may change over time.
Now I would like my script to automatically select the correct passphrase. Which is the best way to accomplish this?