10

I have a list of full remote host ip addresses. I wrote a script to connect all the hosts in this list, one by one. My question is, sometimes when an IP address is down, script waits for a while (maybe a couple of minute) to go and execute next host. So I would like to decrease this waiting time. For example after 10 s, I want ssh connection is timeout and my script tries the next IP address. So how I can tweak this?

Thanks

4

1 回答 1

22

如果你调用 ssh 脚本,你可以使用类似的东西

ssh -o ConnectTimeout=10  <hostName>

其中 10 是秒数

于 2013-08-22T19:39:44.327 回答