SSH idle-timeout adjsutment

Is there a way to adjsut the idle-timeout when connecting through SSH? I read it was in the authorized_keys file, but I don't have that file. Im on OS 10.3.9.
I don't see any sort of setting in the ssh_config file either.

thanks

G5, Mac OS X (10.3.9)

Posted on Nov 22, 2005 11:53 AM

Reply
5 replies

Nov 22, 2005 12:08 PM in response to greg humphrey

It has nothing to do with authorized_keys (which is a list of known/valid host keys), and it's not a client-side control, so it wouldn't be in ssh_config.

It's actually controlled server-side and therefore is in /etc/sshd_config on the server.

The two keys in question are:

ClientAliveInterval
ClientAliveCountMax



The ClientAliveInterval is how often the server sends a keepalive request to the client. ClientAliveCountMax is how many replies can be missed before the server assumes the connection is dead and closes the connection.

For example, setting ClientAliveInterval 5m and ClientAliveCountMax 3 will send a tickle every 5 minutes, disconnecting the link if 3 messages are missed (i.e. 15 minutes).

Nov 22, 2005 12:44 PM in response to greg humphrey

Hi greg,

I guess you want your session never timeout, right?

Then try adding the following line to /etc/ssh_config or ~/.ssh/config of your client Mac (not the server):

ServerAliveInterval 300

Then ssh client will send a packet to the server at least every 300 seconds to prevent the timeout. If the idle-timeout (determined by the server and/or the routers between you and the server) is longer than 300 sec, then the session will never timeout. Please adjust the number to match your environment. If you usually experience the timeout after 10minutes idle (=600 seconds), then 300 will be enough. But if the timeout is shorter then you may need to decrease ServerAliveInterval.

HTH

PowerMac G4 Mac OS X (10.4.3)

Nov 22, 2005 2:04 PM in response to greg humphrey

Yeah that didnt' work.
My sshd_config doesnt coem with those options, so i added them. I tried it both with the # at the begining of the line and without. Ever other line has a # at the begining. Seems odd, but there it is.
BTW, im not on a server per say, just a plain ol mac G5.
I did restart the machine whenever I made a change to the sshd_config file.
The machine still closes the connection after about 5 minutes.

Nov 22, 2005 8:02 PM in response to greg humphrey

Could you please try again with a smaller value, for example

ServerAliveInterval 60

without any # at the begining of the line (any line begining with # is a comment and will be ignored).

Please add this line to the file '~/.ssh/config' of you Mac (the Mac you ssh from).
I guess you don't have file '~/.ssh/config' so please create it.
'~/.ssh/config' means a file 'config' in the directory '.ssh' in your home directory.

PowerMac G4 Mac OS X (10.4.3)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

SSH idle-timeout adjsutment

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.