I needed a way to test if I have a passwordless way to authenticate to another SSH system. This script is written in expect and basically attempts to ssh into the specified host. It assumes the user prompt will contain user@host
.
I should also note that I wrote this with the intention of using it as a Nagios plugin for ssh checks. That is why it exists with the code of 2 (critical) or 3 (unknown) when there are problems.