This commit is contained in:
2023-08-16 14:08:55 +08:00
parent 70d98d97f0
commit 8953356c47
11 changed files with 368 additions and 3 deletions

View File

@@ -141,13 +141,13 @@ func handleSSHConnection(conn net.Conn, serverConfig *ssh.ServerConfig) {
continue
}
connNum++
if connNum > int(conf.Sshd.MaxConnNum) {
log.Error("Maximum number of connections exceeded")
//conn.Write([]byte("Reach max connections"))
conn.Close()
continue
}
connNum++
go handleSSHChannel(conn, sshConn, channel, requests)
}