FTP and SFTP
Created: 2025-11-25 Tags: networking ftp sftp file-transfer protocols
Description
FTP (File Transfer Protocol) and SFTP (SSH File Transfer Protocol) are used for transferring files over networks. SFTP is the secure alternative to FTP.
FTP (Legacy, Insecure)
Characteristics
- Port: 20 (data), 21 (control)
- Unencrypted transmission
- Clear-text credentials
- Active and passive modes
Security Issues
- No encryption: Data and credentials in clear text
- Vulnerable to sniffing: Packet capture reveals everything
- Man-in-the-middle: Easy to intercept
- Should not be used: Use SFTP or FTPS instead
SFTP (Secure Alternative)
Characteristics
- Port: 22 (SSH)
- Encrypted transmission
- Secure authentication
- Part of SSH protocol suite
Advantages
- All data encrypted
- Secure authentication (keys or passwords)
- Single port (firewall friendly)
- File integrity verification
Usage
# Connect
sftp user@host
# Commands
put localfile
get remotefile
ls
cd directory
pwdFTPS (FTP Secure)
- FTP with SSL/TLS
- Port: 990 (implicit) or 21 (explicit)
- Different from SFTP
- More complex than SFTP
Best Practices
- Never use plain FTP: Use SFTP or FTPS
- Use key authentication: For SFTP
- Restrict access: Limit users and directories
- Monitor transfers: Log all activities
- Disable anonymous access: Require authentication
Related Topics
Back to: 00-MOC-Cybersecurity-Roadmap