Edit: There's a bug report for this, doing the equivalent of this answer.
I'm trying to script the copying of public keys to multiple machines. ssh-copy-id checks whether it can log in with the current configuration before copying, but unfortunately this includes any IdentityFile entries in ~/.ssh/config. I would like to completely ignore ~/.ssh/config; is there some way to do that, or to force ssh-copy-id to always add the key? This does not work:
ssh-add "$old_key"
ssh-copy-id -i "$new_key" -o "IdentityFile $new_key" "$login"
This is similar to, but distinct from How can I make ssh ignore .ssh/config?.
ssh-copy-idis itself a shell script. You can try editing it. – muru Feb 11 '15 at 10:14PreferredAuthentications password&PubkeyAuthentication nofor required host in~/.ssh/config. You will use password forssh-copy-idauthentication – AJIOB Oct 22 '22 at 08:28