Authentication is attempted in the following order of priority:
The pkey or key_filename passed in (if any)
Any key we can find through an SSH agent
Any “id_rsa”, “id_dsa” or “id_ecdsa” key discoverable in ~/.ssh/
Plain username/password auth, if a password was given
Я подозреваю третьим пунктом он и id_rsa.pub сам найдет