释放服务器上面sftp-server进程 (#247)

如果不关闭,会在服务器上面产生大量的 /usr/libexec/openssh/sftp-server 进程
This commit is contained in:
xyuer 2022-04-20 22:00:36 +08:00 committed by GitHub
parent d9abc7b5ce
commit a608b84d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,11 @@ func (ret *NextTerminal) Write(p []byte) (int, error) {
}
func (ret *NextTerminal) Close() error {
if ret.SftpClient != nil {
return ret.SftpClient.Close()
}
if ret.SshSession != nil {
return ret.SshSession.Close()
}