提升CentOS上SFTP的安全性可从以下方面入手:
/etc/ssh/sshd_config中设置PermitRootLogin no,禁止root用户通过SFTP登录。sftpuser),并将其主目录权限设为755,属主为root。ChrootDirectory将用户限制在主目录内,防止访问系统其他路径。PasswordAuthentication no),使用SSH密钥对验证,提升认证安全性。AllowTcpForwarding和X11Forwarding,减少潜在攻击面。PasswordAuthentication no。SyslogFacility AUTHPRIV),定期分析/var/log/secure。以上措施可有效增强SFTP的安全性,建议根据实际需求组合使用,并在修改后重启SSH服务生效。