Operating System - HP-UX
1824976 Members
4032 Online
109678 Solutions
New Discussion юеВ

to configure ssh timeout value

 
SOLVED
Go to solution
sethunava
Regular Advisor

to configure ssh timeout value

Hi,
we have HP-UX servers which we will connect from Suse Linux clients usinng ssh client
& use KSH for reusing the commands

In this scenario how & where to configure ssh timeout value so that when ssh session is idle for more than 15 mins automatically
the user has to be logged out of both KSH & SH shells

Thanks
3 REPLIES 3
likid0
Honored Contributor
Solution

Re: to configure ssh timeout value

although you can have timeouts specified on the .profile of your shell, the ssh way is:

by editing the /etc/ssh/sshd_config

Uncommenting the line

ClientAliveInterval 300 ---> this is for 10 minutes
Windows?, no thanks
likid0
Honored Contributor

Re: to configure ssh timeout value

Sorry i forgot to tell you you have to restart
the sshd daemon, to get the new config.

and have a look in this web page for more info on the parameters:

main page of sshd_config (http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config

Windows?, no thanks
Matti_Kurkela
Honored Contributor

Re: to configure ssh timeout value

ClientAliveInterval will cause a logout only when the client machine has been rebooted, or has lost power or network connectivity. It will not help if the client is still working OK but the user has walked away.

The ClientAliveInterval functionality is useful when you need a connection to remain idle but alive for a long time (e.g. monitoring some long-running program that will produce output only when there is an error) and there is a firewall that will stop passing data through if a connection has been idle for a while.

For disconnecting idle sessions, read the man pages of the shells: if you set the TMOUT environment variable, the shell will automatically disconnect idle sessions. If you want to make it a bit more difficult to override the setting, set it in /etc/profile and mark it read-only:

export TMOUT=900 # 900 s = 15 min
readonly TMOUT

MK
MK