Channel inactivity timeouts for sshd(8) #16
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
These patches implement a channel inactivity timeout mechanism for
sshd, that allows different channel types to have different timeouts. Here is an excerpt from thesshd_config.5manpage:ChannelTimeouts
Specifies whether and how quickly sshd(8) should close inactive channels. Timeouts for specified as one or more
"type=interval"pairs separated by whitespace, where the"type"must be a channel type name (as described in the table below), optionally containing wildcard characters."interval"must be a value specified in seconds and may use any of the units documented in the TIME FORMATS section. For example,"session:*=5m"would cause all sessions to terminate after five minutes of inactivity.The available channel types include:
agent-connectionOpen connections to ssh-agent(1).
direct-tcpipdirect-streamlocal@openssh.comOpen TCP or Unix socket (respectively) connections that have been established from a ssh(1) local forwarding, i.e. LocalForward or DynamicForward.
forwarded-tcpipforwarded-streamlocal@openssh.comOpen TCP or Unix socket (respectively) connections that have been established to a sshd(8) listening on behalf of a ssh(1) remote forwarding, i.e. RemoteForward.
session:commandCommand execution sessions.
session:shellInteractive shell sessions.
session:subsystem:...Subsystem sessions, e.g. for sftp(1), which could be identified as
session:subsystem:sftp.x11-connectionOpen X11 forwarding sessions.
Note that, in all the above cases, terminating an inactive session does not guarantee to remove all resources associated with the session, e.g. shell processes or X11 clients relating to the session may continue to execute.
Moreover, terminating an inactive session does not prevent the client from requesting another session of the same type. In particular, expiring an inactive forwarding session does not prevent another identical forwarding from being subsequently created.
The default is not to expire channels of any type for inactivity.