Verify you can ssh to a list of hosts using keys

for i in `cat list` 
do 
    ssh -o "BatchMode yes" root@$i hostname
done

ssh to a list of hosts and run the hostname command to verify you can ssh to the hosts password-lessly. If password-less login is not working, it will not prompt for passphrase or password and will skip it.

man ssh_config

BatchMode
If set to “yes”, passphrase/password querying will be disabled. This option is useful in scripts and other batch jobs where no user is present to supply the password. The argument must be “yes” or “no”. The default is “no”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s