how to decrease ssh connection timeout value [closed]

微笑、不失礼 提交于 2020-01-02 01:56:16

问题


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


回答1:


if you call ssh script you can use something like that

ssh -o ConnectTimeout=10  <hostName>

where 10 is the number of seconds




回答2:


You can learn much more by typing man ssh for OpenSSH command line options and man sshd for OpenSSH daemon options...



来源:https://stackoverflow.com/questions/18389367/how-to-decrease-ssh-connection-timeout-value

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