ChrootDirectory in SFTP Couldn't get handle: Permission denied

I have compiled and installed Openssh 5.3 on my centos 5.3 server following these instructions:

However I CAN NOT seem to get ChrootDirectory to work properly

I have changed so many things at this point I don't even know where I am at this point...

I followed the directions I found here:

I can connect via SFTP but once connected I can't do anything:

computer:~ user$ sftp test2@
Connecting to
tetest2@'s password:
sftp> ls
Couldn't get handle: Permission denied
sftp> cd download
Couldn't canonicalise: Permission denied
sftp> put test.txt
Uploading test.txt to /test.txt
Couldn't get handle: Permission denied

Here are my users settings:
[root@sftp ~]# more /etc/passwd |grep test2
[root@sftp ~]# more /etc/group |grep test2

Here are my settings in /etc/ssh/sshd_config:
# override default of no subsystems
#Subsystem      sftp    /usr/libexec/openssh/sftp-server -f LOCAL1 -l INFO
Subsystem       sftp    internal-sftp

Match group sftponly
ChrootDirectory /chroot/disk2/%u
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp

Here are the permissions of the folder
drwx------   3 root root  4096 Jan  6 04:14 chroot
drwx------  5 root root 4096 Jan  6 11:08 disk2
drwx------ 3 root root 4096 Jan  6 11:11 test2

Now I have found that people saying it is a permission issues so I give test2 ownership of the /chroot/disk2/test2 directory and then when I try to connect it just kicks me out:
Connecting to
test2@'s password:
Connection to closed by remote host.
Connection closed

Who is Participating?
brittonvConnect With a Mentor Author Commented:
Changing the permissions for the parent folders to 701 was the fix.
check the logs in /var/log

Can you copy files using scp?  scp localfilename user@remotehost:/path/to/somewhere

You could have selinux stoping you? `getenforce` if it's set to `1` try `setenforce 0` then give it another go.
All Courses

From novice to tech pro — start learning today.