Does not let user via ssh?

You need to put the designer on the server that is to access the folder with pictures.
Created for this user
sudo adduser --no-create-home designer
Put right to your desired folder
sudo chown designer:designer /var/www/project/public
sudo chmod 755 /var/www/project/public

Added these lines to sshd_config
Match user designer
 ChrootDirectory /var/www/project/public

Set the password and restarted sshd.
When popelce to login under this user get the error "Connection closed by remote host".
Why not let me and do I set up access to the folder?

UPD: found this in the secure log
fatal: bad ownership or modes for chroot directory
UPD2: Here's what I googled for this reason

ChrootDirectory - the owner of the folder should be root and the other user should not be writable.
Otherwise, you will get an error:
fatal: bad ownership or modes for chroot directory
So ChrootDirectory is on the directory above

That is, put in ChrootDirectory /var/www/project. Project, like var www the owner is root.
But now after trying to log in under designer poelchau error
Could not chdir to home directory /home/designer: No such file or directory

Tried to create user with home directory. Now /home/designer is, but the error is the same.
And he authenticates, and then it is rejected.
Last login: Sat Nov 12 00:10:31 from 2016 ***
Could not chdir to home directory /home/designer: No such file or directory
/bin/bash: No such file or directory
Connection to *** closed.
July 2nd 19 at 17:26
2 answers
July 2nd 19 at 17:28
You lock the user in /var/www/project/public, therefore after you login for him / it's your /var/www/project/public.
And it is logical that he does not find any of /var/www/project/public/home/designer nor the /var/www/project/public/bin/bash.

Maybe the user does not need ssh, and sftp will be enough? Raise your ftp server and all.
Yes, sftp would be sufficient. In Linux I am not strong, again according to the manuals trying to do the following:
Added in the sshd_config ForceCommand internal-sftp now user allow sftp, but let only in his directory (/home/designer). In all the manuals they create a directory here for example /home/designer/files, but I need to give access to an existing directory which is in /var/www/project. Is it possible to configure access right? - rupert_Weissnat79 commented on July 2nd 19 at 17:31
You can make a simple crutch:

create in /home/designer link to /var/www/project?

ln-s /var/www/project /home/designer/project
make sure he has the right to write in /var/www/project (if it is necessary to write) - Jeff28 commented on July 2nd 19 at 17:34
Did the directory appeared, but for some reason when popelce to log in, filezilla says "open for read: no such file or directory".
The right to diretorio projects "drwxr-xr-x designer designer" (appointed user by the owner), right on the link - "designer lrwxrwxrwx root" (for some reason the group root and are impossible to change).
What else do you need? - rupert_Weissnat79 commented on July 2nd 19 at 17:37
July 2nd 19 at 17:30
1) make Sure that the designer has access not only to /var/www/project/public, but also all the parent directories
2) You don't need chroot, with him you will need inside the chroot to put all the necessary binaries like /bin/bash, otherwise the shell will not run from chroot access to them is not; simply adjust the rights and restrict the shell with the teams depending on needs

Find more questions by tags Ubuntu