How to timeout idle sftp/ssh sessions without killing foreground processes

Hi,

Recently there have been two patches releases by Sun which add ClientAliveInterval and ClientAliveCountMax to the sshd_config options in Solaris 9.

By setting these options, one can control ssh/sftp timeout. I set ClientAliveInterval to some positive timeout in seconds and ClientAliveCountMax to 0 and then observed that timeout occurs after the specified interval. However, all foreground processes also get killed.

On the other hand, if I set ClientAliveCountMax to a non-zero postive value, ssh never timed out.

So, I wanted to know if there is any solution to this ? Also, is there any other option/file to control sftp/ssh timeout ?

Thanks.

[688 byte] By [chamra] at [2007-11-26 19:39:17]
# 1

> Hi,

> Recently there have been two patches releases by Sun

> which add ClientAliveInterval and ClientAliveCountMax

> to the sshd_config options in Solaris 9.

>

> By setting these options, one can control ssh/sftp

> timeout. I set ClientAliveInterval to some positive

> timeout in seconds and ClientAliveCountMax to 0 and

> then observed that timeout occurs after the specified

> interval. However, all foreground processes also get

> killed.

I would think that would be the expected behavior. When ssh dies, the shell spawned by it is sent a hangup (HUP) signal. The shell will exit, signalling the children. If you want the children to not die, you'd need to take action beforehand. You'd probably want to use nohup to ignore the HUP signal, and you'd also want to make sure that stdin/stdout/stderr are not held by shell.

--

Darren

Darren_Dunhama at 2007-7-9 22:18:18 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...