Hide Forgot
Description of problem: 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. So far, the only solution I found is to have a script that runs regularly and checks if /proc/<sftpserver>/fd/0 access time is older than a certain timestamp, and kill the PID accordingly. Version-Release number of selected component (if applicable): openssh RHEL8, 9 and Upstream How reproducible: Always Steps to Reproduce: 1. sftp localhost Actual results: Connection remains connected forever Expected results: Be able to kill the connection
Created attachment 1919019 [details] Proposed implementation