Bug 1338 - Idletimeout for both client and server
Summary: Idletimeout for both client and server
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 4.6p1
Hardware: All All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 03:09 AEST by Wout Mertens
Modified: 2007-07-23 12:54 AEST (History)
0 users

See Also:


Attachments
IdleTimeout option for ssh & sshd (13.99 KB, patch)
2007-07-11 03:09 AEST, Wout Mertens
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wout Mertens 2007-07-11 03:09:35 AEST
Created attachment 1323 [details]
IdleTimeout option for ssh & sshd

Hi,

I took the idletimeout patch for sshd that Jani Jaakkola <jjaakkol@cs.helsinki.fi> made in 2001 (http://marc.info/?l=openssh-unix-dev&m=99838019319356&w=2) and updated it to work with 4.6p1. Then I added support for ssh as well.

With this patch, an IdleTimeout option is added to both ssh and sshd, which disconnects when no traffic has passed for a predefined time. Time can be specified in seconds, minutes, hours, etc using character modifiers.

The idea is to combine this patch with the ControlPersist patch (#1330) and create an easy way to have persistent ssh connections that clean up automatically. This speeds up scripts and generic admin work.

Some comments:

   * In 2001 the code in packet.c was not organized like it is now with wrapper functions calling ssh1/ssh2 versions. I think I put calls to idletimeout_check() in the right places but I could have missed one or added too much.

   * For the writing case, I added an idletimeout_check() in packet_start instead of in the packet_send, assuming that packet_send will be called soon after packet_start.

   * If this patch is combined with the ControlPersist patch, it should be possible request that ssh only performs the timeout when ssh is daemonized as a master. This could be done by making ControlPersist take the same time value that IdleTimeout does. I'd be happy to code that?
Comment 1 Wout Mertens 2007-07-23 12:54:49 AEST
Please see bug #1330 for a newer version of this patch that is combined with ControlPersist.

The new version is saner and cleaner, and applies cleanly against 4.6p1 and the 2007-7-22 CVS.