I migrated a server a while back and it's been working fine, even the chrooted SSH accounts. The client just noticed however than on those the SFTP doesn't work :
Error: Received unexpected end-of-file from SFTP server
Error: Could not connect to server
The old server was a debian 7 and the new one is debian 8, so I assume some of the binaries in the chroot aren't working anymore (gcc 3 --> 4 problem), but that doesn't seem to be a problem for the chrooted ssh which does work fine. I noticed that if I add a "ForceCommand sftp-internal" in the Match bloc for the user, SFTP works fine. But ofcourse that breaks the ssh. The subsystem used for SFTP is /usr/lib/openssh/sftp-server, I tried switching to "sftp-internal" with no success, even worse that breaks sftp for non-chrooted accounts.
Any idea ? Running sshd in DEBUG doesn't output any error when trying to log in from an SFTP client.
TL;DR :
SSH into chrooted or non-chrooted accounts : OK
SFTP into non-chrooted account : OK
SFTP into chrooted account : NOK
Thanks
EDIT :
The chroot is defined like this :
Match User some_user
ChrootDirectory /ha.0/some_user
And that directory contains a filesystem with everything needed, bash, some libs ..
EDIT 2 : Complete ssh config
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
#Subsystem sftp sftp-internal
UsePAM yes
AllowUsers ...
AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys2
Match User some_user
ChrootDirectory /ha.0/some_user