SSH issue - Disconnecting: Received data for nonexistent channel 0

The log below is from SSHD server when SSH client is trying to connect. I'm sure that I have correct ssh key. I just compared two RHEL5 servers. As I red, this means that server closed the connection for some reason. But any suggestions how to try to solve the issue and find the root cause?

Jul 29 20:12:11 sshd[13259]: subsystem request for sftp
Jul 29 20:12:11 sshd[13259]: channel_by_id: 0: bad id: channel free
Jul 29 20:12:11 sshd[13259]: Disconnecting: Received data for nonexistent channel 0.

OS: RHEL 5.11, SSHD service: default


Solution 1:

I just encountered same error message with very simple cause - full '/' filesystem.

Solution 2:

The error message Disconnecting: Received data for nonexistent channel 0. might be caused by incorrect sshd configuration.

Check if the line Subsystem sftp /usr/lib/openssh/sftp-server (or similar) in /etc/ssh/sshd_config points to the correct binary.

Another cause for the error could be an incorrect setting system shell setting in /etc/passwd for the user. source