title: Public key authorization on sftp chroot directory
body: <p>I want to add public key authorization to my sftp chroot directory but I allways get:</p>
  
  <pre><code>debug1: Next authentication method: publickey
  debug1: Offering RSA public key: /home/test/.ssh/id_rsa
  debug3: send_pubkey_test
  debug2: we sent a publickey packet, wait for reply
  debug1: Authentications that can continue: publickey
  debug2: we did not send a packet, disable method
  debug1: No more authentication methods to try.
  Permission denied (publickey).
  Couldn't read packet: Connection reset by peer
  </code></pre>
  
  <p>Chroot works because authorization with password is possible.
  I have other account on this host without chroot and it works with this key.
  I tried many times, but still it doesn't work.</p>
  
  <p>On server in auth.log there is only:
  Connection closed by xxx [preauth]</p>
  
  <p>This is my directory:</p>
  
  <pre><code>ls -laR /sftp/
  /sftp/:
  total 12
  drwxr-xr-x  3 root root 4096 May  3 16:55 .
  drwxr-xr-x 23 root root 4096 May  3 14:46 ..
  drwxr-xr-x  3 root root 4096 May  3 16:45 backup
  
  /sftp/backup:
  total 12
  drwxr-xr-x 3 root     root      4096 May  3 16:45 .
  drwxr-xr-x 3 root     root      4096 May  3 16:55 ..
  drwxr-xr-x 3 backup sftpusers 4096 May  3 16:55 incoming
  
  /sftp/backup/incoming:
  total 12
  drwxr-xr-x 3 backup sftpusers 4096 May  3 16:55 .
  drwxr-xr-x 3 root     root      4096 May  3 16:45 ..
  drwx------ 2 backup sftpusers 4096 May  3 21:06 .ssh
  
  /sftp/backup/incoming/.ssh:
  total 12
  drwx------ 2 backup sftpusers 4096 May  3 21:06 .
  drwxr-xr-x 3 backup sftpusers 4096 May  3 16:55 ..
  -rw------- 1 backup sftpusers  391 May  3 21:06 authorized_keys
  </code></pre>
  
  <p>My user:</p>
  
  <pre><code>backup:x:1002:1003::/incoming:/usr/sbin/nologin
  </code></pre>
  
  <p>My ssh config:</p>
  
  <pre><code>Match Group sftpusers
    ChrootDirectory /sftp/%u
    AuthorizedKeysFile  /sftp/backup/incoming/.ssh/authorized_keys
    ForceCommand internal-sftp
    AllowTcpForwarding no
    X11Forwarding no
  </code></pre>
  
  <p>Please help.</p>