Timeout to abolish ssh connection command it takes too long

Hi,

I am running a ssh connection test in a script, how can I add a timeout to abolish the process if it takes too long?

ssh -i ~/.ssh/ssl_key useraccount@computer1

Thank you.

  • j

Add tou your ssh:

-o ConnectTimeout=n

Where n is compute as seconds.

1 Like