Create SFTP server
Create user group
groupadd sftp
Create user
useradd sftpuser
passwd sftpuser
usermod -s /sbin/nologin sftpuser
create data directory
mkdir -p /opt/sftpdata/sftpuser
chwon -R root.sftp /opt/sftpdata/sftpuser
mkdir -p /opt/sftpdata/sftpuser/input
mkdir -p /opt/sftpdata/sftpuser/output
chown -R sftpuser.sftp /opt/sftpdata/sftpuser/input
chown -R sftpuser.sftp /opt/sftpdata/sftpuser/output
config sshd_config
vi /etc/ssh/sshd_config
Port 8000
PasswordAuthentication no
AllowAgentForwarding no
AllowTcpForwarding no
Subsystem sftp internal-sftp
Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /opt/sftpdata/%u
ForceCommand internal-sftp