I am experiencing some weird problem in my SFTP server.
Some of my clients not able to connect through sftp using key authentication.
I have chrooted all the sftp users in two different directories where two authorized_keys files were maintained. One of the directory working fine and other is not.
For example: I have a two chroot directory dir1 and dir2 for different users in the same server. I have created a ssh keys and configured the public key in authorized_key of dir1 and connection were established and in other directory(dir2) when i place the keys in authorized_keys the connection breaks with the following error.
debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug3: Wrote 368 bytes for a total of 1645 Connection closed by xx.xx.xx.xx Couldn't read packet: Connection reset by peer
I thought the authorized_key file got corrupted in dir2 but some users are connecting through the key authentication. Also i had downloaded the authorized_key file and placed in different server to test the connection and connection was successful.
Please show me some light.
server Permission for .ssh folder and authorized_keys
drwxr-xr-x 2 root root 12288 Sep 26 10:33 .ssh ]#ll .ssh -rw-r--r-- 1 root root 123243 Sep 26 15:03 authorized_keys
No entry in server logs regarding the issue or connection. While login my sftp banner received to the client but public key tranfer got dropped.
Edited to clarify
When i verified authorized_keys, it shows too many invalid keys and comment keys in the file. Is this due to too many invalid keys.