以下是Debian SFTP的安全加固措施:
~/.ssh/authorized_keys
,禁用密碼認證。/etc/ssh/sshd_config
中設置ChrootDirectory
限制用戶僅能訪問主目錄,配合ForceCommand internal-sftp
禁用Shell。PermitRootLogin no
。X11Forwarding no
、AllowTcpForwarding no
。LogLevel VERBOSE
),定期審查/var/log/auth.log
。配置后需重啟SSH服務生效:sudo systemctl restart sshd
。