2. Ports and Protocols: SSH, HTTP, HTTPS, FTP/SFTP and DNS
2.5 FTP and SFTP
FTP juna protocol aahe – aajun kahi hosting companies vaprtat. Pan tyacha motha problem: username aani password clear text madhe jatat.
| Point | FTP | FTPS | SFTP |
|---|---|---|---|
| Port | 21 (control) + 20 or random (data) | 21/990 + data ports | 22 (runs over SSH) |
| Encryption | None | TLS | SSH |
| Firewall friendliness | Poor (extra data ports) | Poor | Good (one port) |
| Recommended? | No | Only if required | Yes |
sftp -i mykey.pem ec2-user@<PUBLIC_IP> # then: put file.txt, get file.txt, ls, bye
scp -i mykey.pem report.pdf ubuntu@<PUBLIC_IP>:~/
Why this matters for security
With Wireshark (Part 10) you will literally see an FTP password appear in the packet capture. Anonymous FTP login and old vulnerable FTP servers (Metasploitable 2 runs one) are classic lab targets. In real systems, replace FTP with SFTP/SCP over SSH.
Ravindra Bagale's Tip
Many students install vsftpd and open port 21 just to upload files to EC2. There's no need! SSH is already running – in WinSCP, FileZilla or MobaXterm choose the "SFTP" protocol, port 22, and give your key. One less open port means one less risk.
Ravindra Bagale's Tip – मराठी
बरेच students EC2 वर file upload करायला vsftpd install करतात आणि port 21 open करतात. गरज नाही! SSH आधीच चालू आहे – WinSCP, FileZilla किंवा MobaXterm मध्ये protocol "SFTP" निवडा, port 22, आणि तुमची key द्या. एक कमी port open, एक कमी धोका.
Ravindra Bagale's Tip – हिंदी
बहुत से students EC2 पर file upload करने के लिए vsftpd install करते हैं और port 21 open कर देते हैं. ज़रूरत नहीं! SSH पहले से चल रहा है – WinSCP, FileZilla या MobaXterm में protocol "SFTP" चुनो, port 22, और अपनी key दो. एक port कम खुला, एक ख़तरा कम.
Practice task
Connect to any Linux machine with sftp, upload a file, list it, download it back, and exit with bye.