Ravindra BagaleCourses & study guides

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.

Practice task

Connect to any Linux machine with sftp, upload a file, list it, download it back, and exit with bye.