Skip to main content

FTP

For your information

FTP access is only available for buckets in pools ru-1 and ru-7.

When working with buckets, you must use TLS/SSL Explicit encryption (TLS/SSL Explicit encryption).

The FTP protocol uses two connections:

  • a control connection — this is used to transmit commands and responses, which are text strings;
  • a data transfer connection.

S3 uses only passive data transfer mode. The connection establishment and data transfer process is initiated exclusively from the client side.

Appends to files are not supported — when attempting to do so, a 426 response code will be returned.

Connection data

To connect to S3 via FTP, use:

  • FTP host in the required pool;
  • port 21 (control port);
  • port range 10100-12000 (data ports).

Authentication is performed using an S3 key — the Account Owner or a user with the iam.admin role must issue a key to a service user. When connecting via FTP, the Access key and Secret key from the key are used as the username and password, respectively.

Configure FTP

  1. Configure access to S3.
  2. Connect via FTP.

1. Configure access to S3

Access can be configured by the Account Owner or a user with the iam.admin role.

  1. Create a service user with a role with S3 access, except for the s3.bucket.user role — FTP connection will not work with it.

    If you are using a service user with the s3.user or object_storage_user role, a bucket policy must be configured in the bucket, and its rules must allow access to this user.

  2. Issue an S3 key to the user.

2. Connect via FTP

To connect via FTP, you can only use clients that support secure connections via TLS/SSL (FTPS).

  1. Open Total Commander.
  2. In the Net menu, select Connect to FTP server.
  3. Click Add.
  4. On the General tab in the Session field, enter any name (e.g., Servercore).
  5. In the Host name field, enter the FTP host in the required pool.
  6. Select the SSL/TLS checkbox.
  7. In the User name field, enter the value of the Access key field from the S3 key.
  8. In the Password field, enter the value of the Secret key field from the S3 key.
  9. Select the Passive mode (like Web browser) checkbox.
  10. Open the Advanced tab.
  11. In the Encoding field, select UTF-8.
  12. Click OK. The profile will be saved.
  13. Click Connect.

Working with FTP

Authorization

CommandArgumentsDescription
USERAccess key from S3 keyTransfer username
PASSSecret key from S3 keyTransfer password

Security

CommandArgumentsDescription
AUTHNot requiredEstablish a secure TLS connection. Arguments will be ignored
PROTP / CSet protection mode. P for Private, C for Clean. By default, P will use TLS
PBSZBuffer sizeSet the protection buffer size. The server will respond with 200 OK

Misc

CommandArgumentsDescription
FEATNot requiredDisplay a list of supported additional functions
SYSTNot requiredDisplay the server operating system
NOOPNot requiredNo operation; the server will respond with 200 OK
OPTSAs per RFC2389Transfer additional options to the server

File access

CommandArgumentsDescription
SIZEFilenameGet file size
STATNot requiredGet connection statistics
MDTMPathGet the file modification date and time
RETRFilenameDownload a file. Works only after switching to passive mode using the PASV command. Resuming downloads is supported
STORFilenameUpload a file in passive mode
APPEFilenameTell the server to accept a remote file. The command will work only if the file does not already exist in storage. If the file exists, an error will be returned
DELEFilenameDelete a file
RNFRFilenameSelect file for renaming
RNTONew filenameSet a new filename. Only after a file has been selected with the RNFR command
ALLOSize in bytesReturn a response regarding available space. Regardless of the argument, the response will be 202 OK
RESTOffset in bytesCommand to “rewind” to a specific position in a file. Required for resuming downloads using RETR

Working with buckets

CommandArgumentsDescription
CWDDirectory nameChange to the specified directory
PWDNot requiredShow the current working directory
CDUPNot requiredGo to the parent directory
NLSTNot requiredReturn a directory file list in a more concise format than LIST. Only in passive connection mode
LISTPathDisplay contents of the current or provided directory. Both relative and absolute paths are supported
MLSDPathDisplay contents of the current directory. The main difference from LIST relates to timestamps with one-second precision; time is specified in UTC
MKDDirectory nameCreate a directory
RMDDirectory nameDelete a directory

Establishing a connection

CommandArgumentsDescription
TYPEA / IChange data transfer mode. There are two options: ASCII (A) or Binary (I). Any argument is ignored; the command is used for backward compatibility. Only Binary mode is supported
PASVNot requiredSwitch to passive data transfer mode
EPSVNot requiredInitiate a data transfer connection in passive mode. The server will respond with the connection port number
EPRTProtocol version / address / portInitiate a data transfer connection. The command is exclusively for active data transfer mode, so for this command, the server will report that active mode is not supported
PORTNot requiredSwitch to active data transfer mode. The command is exclusively for active data transfer mode, so for this command, the server will report that active mode is not supported
QUITNot requiredDisconnect from the server