It is a cheat sheet for SFTP configuration on CentOS. Long version is on DigitalOcean.
Create a User
sudo adduser xfiles
sudo passwd xfiles
Create a Directory for File Transfers
sudo mkdir -p /var/sftp/uploads
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown xfiles:xfiles /var/sftp/uploads
Configure SSH Deamon
sudo vi /etc/ssh/sshd_config
Match User xfiles
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
Restart SSD Deamon
sudo systemctl restart sshd
Test in the Server
sftp xfiles@localhost