I just set up my SFTP server and it works fine when I use it from my first user account. I wanted to add a user which we will call 'magnarp'. At first I did like this in sshd_config:
Subsystem sftp internal-sftp
Match group sftponly
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
That worked fine enough, user magnarp went into his home directory. I then tried to add a symbolic link to it.
home$ sudo ln -s /home/DUMP/High\ Defenition/ /home/magnarp/"High Defenition"
The symlink worked fine via SSH but not over SFTP.
So what I want to do now is to Chroot group sftponly to /home/DUMP and i did like this:
Match group sftponly
ChrootDirectory /home/DUMP
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
The DUMP folder have permissions as follows.
drwxrwxrwx 5 root root 4096 aug 18 02:25 DUMP
And this is the error code:
Aug 18 16:40:29 nixon-01 sshd[7346]: Connection from 192.168.1.198 port 51354
Aug 18 16:40:30 nixon-01 sshd[7346]: Accepted password for magnarp from 192.168.1.198 port 51354 ssh2
Aug 18 16:40:30 nixon-01 sshd[7346]: pam_unix(sshd:session): session opened for user magnarp by (uid=0)
Aug 18 16:40:30 nixon-01 sshd[7346]: User child is on pid 7467
Aug 18 16:40:30 nixon-01 sshd[7467]: fatal: bad ownership or modes for chroot directory "/home/DUMP"
Aug 18 16:40:30 nixon-01 sshd[7346]: pam_unix(sshd:session): session closed for user magnarp