I have ssh key based authentication setup for some depolyment 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 dont want to change configuration files since the script can be executed from any where.