How FTP works
What FTP is
Understand FTP as a stateful client-server protocol for navigating remote filesystems and transferring files.
FTP is the File Transfer Protocol. It is older than the Web, and people still use it to move files between a client and a server.
You log in, change directories, list files, download, upload, rename, and delete. The server decides what your account can do.
What I like about FTP is how readable it is. Commands and numeric replies show up in plain text. You can follow the whole session in a terminal without guessing what happened behind the scenes.
That readability is also why cleartext FTP is dangerous on open networks. Everything you type is visible to the path.
Connect to a test server and watch the first few lines:
$ ftp files.partner.test
Connected to files.partner.test.
220 FTP server ready
Name: alice
331 Password required
Password: ****
230 User logged in
ftp> pwd
257 "/uploads" is the current directory
ftp> ls
150 Opening data connection
226 Transfer complete
That same design carries old assumptions. FTP does not play nicely with modern firewalls the way HTTPS or SFTP does. You will still meet it on legacy appliances and partner gateways.
FTP is stateful. The server remembers who logged in, which directory you are in, and how the next transfer should run. Those details stick around across commands.
Commands and replies travel on one long-lived control connection. Listings and file bytes use separate data connections. That split is why so many transfers fail behind NAT even when login works.
Classic FTP without TLS sends credentials and file contents in cleartext. A successful login does not mean the session is safe on the public Internet.
Try one listing and one download with verbose output on a server you own. Mark the control replies and the moment the data connection opens.
Lesson completed