I used following command to jail the user:
jk_jailuser -m -j /home/chrootssh/ test-anebi
In auth.log following things happen:
When i connect with SFTP:
Apr 4 09:06:25 labs sshd[22685]: Accepted password for test-anebi from 89.215.8.109 port 60208 ssh2
Apr 4 09:06:25 labs sshd[22685]: pam_unix(sshd:session): session opened for user test-anebi by (uid=0)
Apr 4 09:06:26 labs sshd[8070]: subsystem request for sftp by user test-anebi
When i connect with SSH
Apr 4 09:07:03 labs sshd[6482]: Accepted password for test-anebi from 89.215.8.109 port 60253 ssh2
Apr 4 09:07:03 labs sshd[6482]: pam_unix(sshd:session): session opened for user test-anebi by (uid=0)
Apr 4 09:07:03 labs jk_chrootsh[15416]: now entering jail /home/chrootssh for user test-anebi (1008) with arguments
Olivier, yes, i do have little bit changed ssh config, i have changed SFTP subsystem
from
Subsystem sftp /usr/lib/openssh/sftp-server
to
Subsystem sftp internal-sftp
# Rules for sftponly group
Match group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I tried yesterday reverting this change, but still same problem, so i am not sure if this can cause this problem.
I will try to reproduce the problem on a clean system without any configuration changes to see if it will happen there.