For the same user, I have two keys on the local machine. On the remote server, both keys are in the authorized_keys
file.
I delete one of the keys in the authorized_keys
file.
I then try to ssh with the other key using the -i option. It succeeds. The auth log shows that the other (undeleted) key in the authorized_keys
file was used to log in - despite me having tried to use the deleted key with the -i option.
Is this normal behavior?
I would expect that ssh only tried to use the key that was specified with the -i option. I know that when no key is specified it tries them all. Shouldn't that not happen when a key is explicitly specified? Or is it more like, tried the specified key first, then try the rest anyway.
Is the expected behavior documented somewhere?