How to increase the default time out for SSH on OS X?

How to increase the default time out when trying to connect to a remote machine via SSH on Mac OS X?

ssh -D 9999 user@host

2 Answers

You need to change the ServerAliveInterval, as explained in ssh_config(5):

Sets a timeout interval in seconds after which if no data has been received from the server, ssh will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server.

For example, create ~/.ssh/config and add:

Host * ServerAliveInterval 120

This will apply to all connections. For a single connection, just use the -o option as explained in ssh(1):

ssh -o ServerAliveInterval=120 user@host
3

Specify the option "ConnectTimeout" for connection timeout, eg

ssh -o ConnectTimeout=240 -D 9999 user@host

Or in ~/.ssh/config add

Host * ConnectTimeout 240
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like