Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sftp: implement session timeout to automatically close idle connections #350

Closed
wants to merge 1 commit into from

Conversation

rmetrich
Copy link

See https://bugzilla.mindrot.org/show_bug.cgi?id=3484

Currently there is no way for the sftp backend (sftp-server or internal-sftp) to close idle connections (by idle I mean no order sent for some time by the sftp client).

This is very problematic for SFTP servers because clients can remain connected, which consumes file descriptors and resources in general, causing potentially system limits to be reached.
This is a case I handled recently, where system-wide file descriptors were exhausted, due to left-opened sftp sessions + corresponding systemd sessions.

There are ClientAlive* properties but these only work for dead clients.

This PR implements the functionality through a new -t <timeout> option passed to sftp-server or internal-sftp executables.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
@djmdjm
Copy link
Contributor

djmdjm commented Dec 20, 2022

I don't want to do this in sftp-server, see djmdjm/openssh-wip#16 for a more general mechanism

@djmdjm
Copy link
Contributor

djmdjm commented Feb 10, 2023

The more general mechanism was released in OpenSSH 9.2

@djmdjm djmdjm closed this Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants