first of all I don't know what is ChrootDirectory, I so an example it was working as you can see in example A, but when i chage setting it deosn't work as in example B
Set /etc/ssh/sshd_config to
This way user1 can login to /var/www/ using sftp.
But when I change
And ChrootDirectory /var/www/html/public
User can’t login I get following error
Accepted password for user1 from 10.1.3.76 port 53711 ssh2
pam_unix(sshd:session): session opened for user user1 by (uid=0)
fatal: bad ownership or modes for chroot directory "/var/www/public"
pam_unix(sshd:session): session closed for user user1