/etc/ssh/sshd_config file with your favorite text editor:
line to look like the following:
Add this block of settings to the end of the file:
Save the changes to your file. Restart OpenSSH:
Modify User Accounts
Create a system group for users whom you want to restrict to SFTP access:
Modify the user accounts that you wish to restrict to SFTP. Issue the following commands for each account, substituting the appropriate username. Please keep in mind that this will prevent these users from being able to log into a remote shell session.
Next, you need to create new directories for each user, to which they will have full access. Issue the following commands for each user, changing the directories created to suit your needs:
Настройки sshd /etc/ssh/sshd_config
ChrootDirectory - владельцем этой папки должен быть root и у других пользователейне должно быть прав на запись.
В противном случае получим ошибку: fatal: bad ownership or modes for chroot directory