Skip to main content
FTP
Last update:

FTP

Two connections are used for the FTP protocol to work:

  • control connection — commands and responses are sent over it, they are text strings;
  • data connection.

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

Writing to the end of the file is not supported — attempting to do so will return response code 426.

FTP connection is only available for containers in the bullet ru-1.

Connection data

To connect to object storage via FTP is used:

Authentication is done with an S3 key — Account Owner or User Administrator produces a key to the service user. When connecting via FTP, the fields Access key and Secret key from the key are used as login and password respectively.

Configure FTP

  1. Configure access.
  2. Connect via FTP.

Set up access

Access can be configured by a user with role Account Owner or User Administrator.

  1. Create a service user с a role with access to object storage. If you are using a user with the Object Storage User role, the container must be configured with the access policy.
  2. Issue an S3 key to the user.

Connect via FTP

Connect on Windows

  1. Open Total Commander.
  2. On the menu. Network select Connect to an FTP server.
  3. Click Add.
  4. On the tab General in the field Connection name enter any name (e.g. Selectel).
  5. In the field Server enter FTP host.
  6. In the field Account enter the value of the field Access key from S3 key.
  7. In the field Password enter the value of the field Secret key from the S3 key.
  8. Check the box Passive exchange mode (like a Web browser).
  9. Open the tab Extended.
  10. In the field File name encoding select UTF-8.
  11. Click OK. The profile will be saved.
  12. Click Connect.

Connect on Linux

  1. Use Nautilus to open any directory.
  2. On the menu. File select Connecting to the server.
  3. In the field Server address enter FTP host.
  4. Click Connect.
  5. Select an item Registered user.
  6. Enter login — field value Access key from S3 key.
  7. Enter password — field value Secret key from the S3 key.
  8. Optional: check the checkbox To remember forever.
  9. Click Connect.

FTP operation

Authorization

TeamArgumentsDesignation
USERAccess key from S3 keyPass login
PASSSecret key from the S3 keyPass the password

Defense

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

Miscellaneous

TeamArgumentsDesignation
FEATNot requiredDisplay a list of supported additional functions
SYSTNot requiredDisplay the server operating system
NOOPNot requiredEmpty operation, the server will respond with 200 OKs
OPTSAccording to RFC2389.Pass additional options to the server

File access

TeamArgumentsDesignation
SIZEFile nameGet file size
STATNot requiredGet connection statistics
MDTMPathGet the date and time of file modification
RETRFile nameDownload file. It will work only after switching to passive mode with PASV command. Docking is supported
STORFile nameUpload a file in passive mode
APPEFile nameTell the server to accept the remote file. The command will work only if such a file does not exist in the storage yet. If the file exists, an error will be returned
DELEFile nameDelete file
RNFRFile nameSelect the file to rename
RNTONew file nameSet a new file name. Only after the RNFR command has been selected
ALLOSize in bytesReturn a response about available space. Regardless of the argument, the response will be 202 OK
RESTOffset in bytesCommand to "rewind" to a specific position in the file. Required for downloading with RETR

Working with containers

TeamArgumentsDesignation
CWDDirectory nameGo to the specified directory
PWDNot requiredShow the current working directory
CDUPNot requiredGo to the parent directory
NLSTNot requiredReturn a list of directory files in a shorter format than LIST. Only in passive connection mode
LISTPathOutput the contents of the current or provided directory. Both relative and absolute paths are supported
MLSDPathOutput the contents of the current directory. The main difference from LIST is that time stamps are accurate to the second, time is specified in UTC
MKDDirectory nameCreate a directory
RMDDirectory nameDelete directory

Establishing a connection

TeamArgumentsDesignation
TYPEA / IChange the mode of data transmission. There are two options, ASCII(A) or Binary(I). Either 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 passive mode data connection. In response, the server will transmit the port number for the connection
EPRTProtocol version / address / portInitiate a data connection. The command is exclusive to active data transfer mode, so the server will report to this command that active mode is not supported
PORTNot requiredSwitch to active data transfer mode. The command is exclusive to active data transfer mode, so the server will report to this command that active mode is not supported
QUITNot requiredDisconnect from the server