check is SSH prompt for password or not

ε祈祈猫儿з 提交于 2019-12-04 04:40:10
for host in host1 host2 host3; do
    ssh -o PasswordAuthentication=no $host command
done

To make it parallel add &:

for host in host1 host2 host3; do
    ssh -o PasswordAuthentication=no $host command &
done

If this is a thing you do regularly, I would suggest looking at dsh. http://www.tecmint.com/using-dsh-distributed-shell-to-run-linux-commands-across-multiple-machines/

it allows you to make a list of your servers, and run commands against ALL of them, or just subsets(web, db, app, etc)

you can create global files, or create your own personal files.

ssh has an option, called BatchMode.

You can use it like

ssh -o BatchMode ...

and it won't ask you anything, but skip the connection attempt.

Or use rundeck - this can be found at http://rundeck.org

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!