Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I configure SSH session timeouts to 15 minutes in Solaris?

1936333Dec 12 2014 — edited Dec 12 2014

I've done some testing on this already, & I've learned that the TMOUT variable in bash (& ksh) is the one that controls the session timeouts, but only for interactive login shells (e.g., when I do "ssh hostname"). Scripted sessions are not affected (e.g., when I do 'ssh hostname "./test.sh"' & the script simply does a "sleep 960" then at the end runs the date command & outputs it to a test file on the remote box).

My initial research told me to set "ClientAliveInterval" & "ClientAliveCountMax" to 300 & 3, respectively, in /etc/ssh/sshd_config, then restart the sshd service (we run Solaris 10 & 11). But I tested it & those variables didn't do the job (my interactive login session stayed up forever). So then I tried the TMOUT variable in bash, set it to 900 in ".bash_profile", & it worked (i.e., I got disconnected after 15 minutes of inactivity).

Having already answered my own question, I ask the community if someone knows of another way to configure SSH session timeouts aside from the TMOUT variable in bash & ksh (we only use bash in our environment). The variables I mentioned in sshd_config don't seem to have any effect whatsoever, based on my tests.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2015
Added on Dec 12 2014
1 comment
2,412 views