I have an SSH key based authentication setup for some deployment script. But there is a chance that the authentication files are not setup properly at some point. I don't want my shell scripts to ask for passwords, I want them to fail immediately.
Using
ssh -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no -o PubkeyAuthentication=yes test@host
or some thing along those lines does not work. I do not want to change configuration files since the script can be executed from any where.