Concepts / Network services

Network services

FTP

Also called file transfer protocol, active mode, passive mode, PASV, PORT, EPSV, data channel, control channel

File transfer over two kinds of connection: commands on port 21, and a separate data connection per transfer.

Two connections, and who opens the second
Two connections, and who opens the second

Commands go on one connection to port 21; every file gets a second one. In active mode the server opens it back to the client, which NAT blocks; in passive mode the client opens it, which works.

FTP copies files over two TCP connections. The control channel (port 21) carries commands (USER, PASS, RETR, STOR) and replies; each file or listing travels on its own data connection. In active mode (PORT) the server connects back, from port 20; in passive mode (PASV, EPSV) the client connects to a port the server names. Behind NAT only passive works. Plain FTP sends the password in the clear.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab