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 connection establishment and data transfer process is initiated solely on the client side.

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

Connection data

To connect to object storage via FTP is used:

  • host ftp.ru-1.storage.selcloud.ru, where ru-1 is the pool that hosts the object storage;
  • port 21.

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

Configure FTP

  1. Configure access.
  2. Connect by FTP.

1. Configure access

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

  1. Create a service user with role with access to object storage: Account Administrator, Project Administrator, Object Storage Administrator. The Object Storage User role is not suitable for FTP operations.
  2. Issue the user an S3 key.

2. Connect via FTP

Connect on Windows

  1. Open Total Commander.
  2. From the Network menu, select Connect to FTP server.
  3. Press Add.
  4. On the General tab, enter any name (for example, Selectel) in the Connection Name field.
  5. In the Server field, enter ftp.ru-1.storage.selcloud.ru.
  6. In the Account field, enter the value of the Access key field from S3-key.
  7. In the Password field, enter the value of the Secret key field from the S3 key.
  8. Check the Passive sharing mode (as Web browser) checkbox.
  9. Open the Advanced tab.
  10. In the File Name Encoding field, select UTF-8.
  11. Press OK. The profile will be saved.
  12. Press Connect.

Connect on Linux

  1. Use Nautilus to open any directory.
  2. From the File menu, select Server Connection.
  3. In the Server Address field, type ftp://ftp.ru-1.storage.selcloud.ru
  4. Press Connect.
  5. Select Registered User.
  6. Enter the login — value of the Access key field from S3-key.
  7. Enter the password — the value of the Secret key field from the S3 key.
  8. Optional: check the Remember Forever checkbox.
  9. Press Connect.

Working with FTP

Authorization

CommandArgumentsDesignation
USERAccess key from S3 keyPass login
PASSSecret key from S3 keyPass password

Defense

CommandArgumentsDesignation
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 size of the protection buffer. The server will respond with 200 OK

Miscellaneous

CommandArgumentsDesignation
FEATNot requiredDisplay a list of supported optional features
SYSTNot requiredDisplay server operating system
NOOPNot requiredEmpty operation, server will respond with 200 OK
OPTSAccording to RFC2389Pass additional options to server

Accessing files from

CommandArgumentsDesignation
SIZE SIZEFile nameGet file size
STATNot requiredGet connection statistics
MDTMPathGet date and time the file was modified
RETRFile nameDownload file. It will only be triggered after switching to passive mode with the PASV command. Docking is supported
STORFile nameUpload 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 repository yet. If the file exists, an error will be returned
DELEFile NameDelete File
RNFRFile NameSelect a file to rename
RNTONew File NameSet a new file name. Only after being selected by the RNFR command
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

CommandArgumentsDesignation
CWDDirectory nameGo to the specified directory
PWDNot requiredShow current working directory
CDUPNot requiredGo to parent directory
NLSTNot requiredReturn a list of directory files in a shorter format than LIST. Passive connection mode only
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 directory
RMDDirectory nameDelete directory

Establishing a connection

CommandArgumentsDesignation
TYPEA / IChange data transmission mode. There are two options available, ASCII(A) or Binary(I). Any argument is ignored, the command is used for backward compatibility. Only Binary mode 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 to this command the server will report that active mode is not supported
PORTNot requiredSwitch to active data transfer mode. The command is for active data transfer mode only, so the server will report to this command that active mode is not supported
QUITNot requiredDisconnect from server