By default on my testserver and real server, I can walk out of my /home directory and view other peoplese files when using SFTP (or SSH). So user is not real chrooted.
I think I remember that this worked first time I tested, but not any more..
What is the best way to correct this? I have found a guide that explains how to do this step by step:
https://wiki.archlinux.org/index.php/SFTP_chrootI have changed sshd to this:
Match Group vhosts
ChrootDirectory %h
ForceCommand internal-sftp
AllowTCPForwarding no
X11Forwarding no
Filezilla gives this:
Connected to XXX
Error: Received unexpected end-of-file from SFTP server
Sercure-log gives this:
Apr 25 16:27:05 myhost1 sshd[35917]: pam_unix(sshd:session): session opened for user mytestuser by (uid=0)
Apr 25 16:27:05 myhost1 sshd[35919]: subsystem request for sftp
Apr 25 16:27:05 myhost1 sshd[35917]: pam_unix(sshd:session): session closed for user mytestuser
I have chown root for home-directory and I have added mytestuser to the group vhosts (a built in group already present would be better).