Wednesday, June 11, 2014

Checking Passwordless Login Enabled or Not

If you want to check if passwordless login enabled or not on the given host then below is the command which can be used to check for the same.

ssh -o StrictHostKeyChecking=no -o NumberOfPasswordPrompts=0 host0103 "echo hello"

We can run this in for loop for the number of hosts and it will either print error if password less login is not allowed or print the word "hello" if it is enabled.