JSch not closing sshd

给你一囗甜甜゛ 提交于 2019-12-02 05:11:48

问题


Has anyone seen where JSch leaves sshd sessions open?

I've got a java client which performs regular SFTP connections (it polls every one hour) and it seems to leave behind a sshd session. These eventually build up over time and causes us to have a "too many files open" exception in the OS (it hits the limit per process(1024) for those who are interested).

In my client I close the SFTPChannel, then the Channel (redundant really as closing the SFTPChannel closes the Channel) and lastly the Session, so I'm pretty sure I'm cleaning up correctly (and I can see I have a 'disconnect' for each 'connect', so they do marry up)


回答1:


Please refer to a mail thread of jsch-users ML,

That problem has been caused by a bug in older OpenSSH's sshd. The recent OpenSSH has fixed it.



来源:https://stackoverflow.com/questions/7398634/jsch-not-closing-sshd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!