useradd -d /home/sftpuser -s /sbin/nologin sftpuser
passwd sftpuser
mkdir /home/sftpuser/upload
chown -R root:sftpuser /home/sftpuser
chmod -R 755 /home/sftpuser
vi /etc/ssh/sshd_config
Match User sftpuser
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
#将Match块放在sshd_config文件最后