Set Root folder for SFTP users to home folder

Written on 20 January 2016

After this line:
Subsystem sftp /usr/lib/openssh/sftp-server Add

 Match Group sftponly
   ChrootDirectory %h
   ForceCommand internal-sftp
   AllowTcpForwarding no
   PermitTunnel no
   X11Forwarding no

Add group groupadd sftponly then add sfto user to group

usermod username -g sftponly  

Prevent ssh access , deny ssh access

sudo usermod -s /bin/false username  

Read more at:
https://wiki.archlinux.org/index.php/SFTP_chroot
https://bensmann.no/restrict-sftp-users-to-home-folder/

Read more on SFTP Linux Server