Commands and files

Connect and log in

Read the greeting and use USER and PASS without mistaking protocol examples for a safe cleartext login.

8 minute lesson

~~~

The server normally greets a new control connection with 220. The client sends USER; a 331 reply asks for a password, and 230 confirms login.

S: 220 FTP server ready
C: USER alice
S: 331 Password required
C: PASS ...
S: 230 User logged in

Classic FTP sends these commands over cleartext. Use this transcript to understand the protocol, not as a recommendation to expose credentials on an unprotected network.

The greeting can also defer or reject the connection. 120 asks the client to wait for a later greeting; 421 means the service is unavailable and the server will close the control connection.

Authentication is a sequence:

C: USER alice
S: 331 User name okay, need password
C: PASS ...
S: 530 Login incorrect

After 530, the session is not authenticated. Do not continue with file commands or retry passwords rapidly. Check the exact account, server policy, and lockout behavior.

With explicit FTPS, send AUTH TLS and complete certificate-validated TLS before credentials. With SFTP, none of this transcript applies because SFTP authenticates through SSH and is a different protocol.

Use a test account with narrow permissions. Capture the greeting and login result without recording the password. Mark the reply that changes the session into authenticated state.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →