以下是Linux SFTP安全设置指南:
sudo apt-get install openssh-server,CentOS/RHEL系统用sudo yum install openssh-server。/etc/ssh/sshd_config中指定的SFTP用户组,如sftpusers,再创建用户并加入该组,设置用户主目录及权限,确保主目录属主为root,权限为755。/etc/ssh/sshd_config,启用SFTP子系统,如Subsystem sftp internal - sftp;限制用户组,如Match Group sftpusers;设置ChrootDirectory为用户主目录;禁止X11转发和TCP转发;还可设置ForceCommand internal - sftp等。sudo systemctl restart sshd重启服务使设置生效。