I have tested and the "IdentityFile" directive in /etc/ssh/ssh_config does not count as "user defined". I'd have preferred if that would count as well, but for now at least preferring the "-i" is better than nothing and it seems to not need a major overhaul.
But other than that, this seems to work.
Former:
$ ssh -i /tmp/testkey -v horsea "echo 1" |& grep "Will attempt"
debug1: Will attempt key: /home/paelzer/.ssh/id_rsa RSA ... agent
debug1: Will attempt key: ubuntu@cpaelzer-bastion RSA ... agent
debug1: Will attempt key: paelzer@lap RSA ... agent
debug1: Will attempt key: <email address hidden> RSA ... agent
debug1: Will attempt key: /tmp/testkey RSA ... explicit
@Rob - could you give the PPA a try and report for your case the following once for the old and once for the PPAs ssh binary?
$ ssh -i <yournewkey> -v <targethost> "echo 1" |& grep "Will attempt"
I have a PPA at: /launchpad. net/~paelzer/ +archive/ ubuntu/ bug-872145- ssh-prefer- user-configured -key
https:/
I have tested and the "IdentityFile" directive in /etc/ssh/ssh_config does not count as "user defined". I'd have preferred if that would count as well, but for now at least preferring the "-i" is better than nothing and it seems to not need a major overhaul.
But other than that, this seems to work. .ssh/id_ rsa RSA ... agent cpaelzer- bastion RSA ... agent
Former:
$ ssh -i /tmp/testkey -v horsea "echo 1" |& grep "Will attempt"
debug1: Will attempt key: /home/paelzer/
debug1: Will attempt key: ubuntu@
debug1: Will attempt key: paelzer@lap RSA ... agent
debug1: Will attempt key: <email address hidden> RSA ... agent
debug1: Will attempt key: /tmp/testkey RSA ... explicit
Becomes: .ssh/id_ rsa RSA ... agent cpaelzer- bastion RSA ... agent
$ ssh -i /tmp/testkey -v horsea "echo 1" |& grep "Will attempt"
debug1: Will attempt key: /tmp/testkey RSA ... explicit
debug1: Will attempt key: /home/paelzer/
debug1: Will attempt key: ubuntu@
debug1: Will attempt key: paelzer@lap RSA ... agent
debug1: Will attempt key: <email address hidden> RSA ... agent
@Rob - could you give the PPA a try and report for your case the following once for the old and once for the PPAs ssh binary?
$ ssh -i <yournewkey> -v <targethost> "echo 1" |& grep "Will attempt"