title: chroot not changing to home directory
body: <p>I have set up chroot in sshd_config in Redhat. It works as expected.</p>
  
  <p>When a user logs in, they end up in the chroot directory, not in their home directory. Why?</p>
  
  <p>Example: chroot is set to /home/test. User bob logs in. In /etc/passwd, bob's home directory is /here. I expect bob's to end up in /home/test/here (which does exist and is owned by bob). Instead, he ends up in /home/test.</p>
  
  <p>According to the man, after chroot runs, it sets the user's directory to the home directory. Chroot sets the root to /home/test. So, it SHOULD set home directory to /here. It doesn't and I can't find any message to give me a hint what the problem might be.</p>
  
  <p>The changes to /etd/sshd_config are:</p>
  
  <pre><code>Match User bob
  ForceCommand internal-sftp
  PasswordAuthentication yes
  ChrootDirectory /home/test
  PermitTunnel no
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no
  </code></pre>
  
  <p>In /etc/passwrd, the relevant line is:</p>
  
  <pre><code>bob:x:1001:1001:SFTP Test:/here:/bin/bash
  </code></pre>