github.com/rclone/rclone@v1.66.1-0.20240517100346-7b89735ae726/docs/content/ftp.md (about) 1 --- 2 title: "FTP" 3 description: "Rclone docs for FTP backend" 4 versionIntroduced: "v1.37" 5 --- 6 7 # {{< icon "fa fa-file" >}} FTP 8 9 FTP is the File Transfer Protocol. Rclone FTP support is provided using the 10 [github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) 11 package. 12 13 [Limitations of Rclone's FTP backend](#limitations) 14 15 Paths are specified as `remote:path`. If the path does not begin with 16 a `/` it is relative to the home directory of the user. An empty path 17 `remote:` refers to the user's home directory. 18 19 ## Configuration 20 21 To create an FTP configuration named `remote`, run 22 23 rclone config 24 25 Rclone config guides you through an interactive setup process. A minimal 26 rclone FTP remote definition only requires host, username and password. 27 For an anonymous FTP server, see [below](#anonymous-ftp). 28 29 ``` 30 No remotes found, make a new one? 31 n) New remote 32 r) Rename remote 33 c) Copy remote 34 s) Set configuration password 35 q) Quit config 36 n/r/c/s/q> n 37 name> remote 38 Type of storage to configure. 39 Enter a string value. Press Enter for the default (""). 40 Choose a number from below, or type in your own value 41 [snip] 42 XX / FTP 43 \ "ftp" 44 [snip] 45 Storage> ftp 46 ** See help for ftp backend at: https://rclone.org/ftp/ ** 47 48 FTP host to connect to 49 Enter a string value. Press Enter for the default (""). 50 Choose a number from below, or type in your own value 51 1 / Connect to ftp.example.com 52 \ "ftp.example.com" 53 host> ftp.example.com 54 FTP username 55 Enter a string value. Press Enter for the default ("$USER"). 56 user> 57 FTP port number 58 Enter a signed integer. Press Enter for the default (21). 59 port> 60 FTP password 61 y) Yes type in my own password 62 g) Generate random password 63 y/g> y 64 Enter the password: 65 password: 66 Confirm the password: 67 password: 68 Use FTP over TLS (Implicit) 69 Enter a boolean value (true or false). Press Enter for the default ("false"). 70 tls> 71 Use FTP over TLS (Explicit) 72 Enter a boolean value (true or false). Press Enter for the default ("false"). 73 explicit_tls> 74 Remote config 75 -------------------- 76 [remote] 77 type = ftp 78 host = ftp.example.com 79 pass = *** ENCRYPTED *** 80 -------------------- 81 y) Yes this is OK 82 e) Edit this remote 83 d) Delete this remote 84 y/e/d> y 85 ``` 86 87 To see all directories in the home directory of `remote` 88 89 rclone lsd remote: 90 91 Make a new directory 92 93 rclone mkdir remote:path/to/directory 94 95 List the contents of a directory 96 97 rclone ls remote:path/to/directory 98 99 Sync `/home/local/directory` to the remote directory, deleting any 100 excess files in the directory. 101 102 rclone sync --interactive /home/local/directory remote:directory 103 104 ### Anonymous FTP 105 106 When connecting to a FTP server that allows anonymous login, you can use the 107 special "anonymous" username. Traditionally, this user account accepts any 108 string as a password, although it is common to use either the password 109 "anonymous" or "guest". Some servers require the use of a valid e-mail 110 address as password. 111 112 Using [on-the-fly](#backend-path-to-dir) or 113 [connection string](/docs/#connection-strings) remotes makes it easy to access 114 such servers, without requiring any configuration in advance. The following 115 are examples of that: 116 117 rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) 118 rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): 119 120 The above examples work in Linux shells and in PowerShell, but not Windows 121 Command Prompt. They execute the [rclone obscure](/commands/rclone_obscure/) 122 command to create a password string in the format required by the 123 [pass](#ftp-pass) option. The following examples are exactly the same, except use 124 an already obscured string representation of the same password "dummy", and 125 therefore works even in Windows Command Prompt: 126 127 rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM 128 rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: 129 130 ### Implicit TLS 131 132 Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to 133 be enabled in the FTP backend config for the remote, or with 134 [`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and 135 can be set with [`--ftp-port`](#ftp-port). 136 137 ### Restricted filename characters 138 139 In addition to the [default restricted characters set](/overview/#restricted-characters) 140 the following characters are also replaced: 141 142 File names cannot end with the following characters. Replacement is 143 limited to the last character in a file name: 144 145 | Character | Value | Replacement | 146 | --------- |:-----:|:-----------:| 147 | SP | 0x20 | ␠ | 148 149 Not all FTP servers can have all characters in file names, for example: 150 151 | FTP Server| Forbidden characters | 152 | --------- |:--------------------:| 153 | proftpd | `*` | 154 | pureftpd | `\ [ ]` | 155 156 This backend's interactive configuration wizard provides a selection of 157 sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. 158 Just hit a selection number when prompted. 159 160 {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/ftp/ftp.go then run make backenddocs" >}} 161 ### Standard options 162 163 Here are the Standard options specific to ftp (FTP). 164 165 #### --ftp-host 166 167 FTP host to connect to. 168 169 E.g. "ftp.example.com". 170 171 Properties: 172 173 - Config: host 174 - Env Var: RCLONE_FTP_HOST 175 - Type: string 176 - Required: true 177 178 #### --ftp-user 179 180 FTP username. 181 182 Properties: 183 184 - Config: user 185 - Env Var: RCLONE_FTP_USER 186 - Type: string 187 - Default: "$USER" 188 189 #### --ftp-port 190 191 FTP port number. 192 193 Properties: 194 195 - Config: port 196 - Env Var: RCLONE_FTP_PORT 197 - Type: int 198 - Default: 21 199 200 #### --ftp-pass 201 202 FTP password. 203 204 **NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). 205 206 Properties: 207 208 - Config: pass 209 - Env Var: RCLONE_FTP_PASS 210 - Type: string 211 - Required: false 212 213 #### --ftp-tls 214 215 Use Implicit FTPS (FTP over TLS). 216 217 When using implicit FTP over TLS the client connects using TLS 218 right from the start which breaks compatibility with 219 non-TLS-aware servers. This is usually served over port 990 rather 220 than port 21. Cannot be used in combination with explicit FTPS. 221 222 Properties: 223 224 - Config: tls 225 - Env Var: RCLONE_FTP_TLS 226 - Type: bool 227 - Default: false 228 229 #### --ftp-explicit-tls 230 231 Use Explicit FTPS (FTP over TLS). 232 233 When using explicit FTP over TLS the client explicitly requests 234 security from the server in order to upgrade a plain text connection 235 to an encrypted one. Cannot be used in combination with implicit FTPS. 236 237 Properties: 238 239 - Config: explicit_tls 240 - Env Var: RCLONE_FTP_EXPLICIT_TLS 241 - Type: bool 242 - Default: false 243 244 ### Advanced options 245 246 Here are the Advanced options specific to ftp (FTP). 247 248 #### --ftp-concurrency 249 250 Maximum number of FTP simultaneous connections, 0 for unlimited. 251 252 Note that setting this is very likely to cause deadlocks so it should 253 be used with care. 254 255 If you are doing a sync or copy then make sure concurrency is one more 256 than the sum of `--transfers` and `--checkers`. 257 258 If you use `--check-first` then it just needs to be one more than the 259 maximum of `--checkers` and `--transfers`. 260 261 So for `concurrency 3` you'd use `--checkers 2 --transfers 2 262 --check-first` or `--checkers 1 --transfers 1`. 263 264 265 266 Properties: 267 268 - Config: concurrency 269 - Env Var: RCLONE_FTP_CONCURRENCY 270 - Type: int 271 - Default: 0 272 273 #### --ftp-no-check-certificate 274 275 Do not verify the TLS certificate of the server. 276 277 Properties: 278 279 - Config: no_check_certificate 280 - Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE 281 - Type: bool 282 - Default: false 283 284 #### --ftp-disable-epsv 285 286 Disable using EPSV even if server advertises support. 287 288 Properties: 289 290 - Config: disable_epsv 291 - Env Var: RCLONE_FTP_DISABLE_EPSV 292 - Type: bool 293 - Default: false 294 295 #### --ftp-disable-mlsd 296 297 Disable using MLSD even if server advertises support. 298 299 Properties: 300 301 - Config: disable_mlsd 302 - Env Var: RCLONE_FTP_DISABLE_MLSD 303 - Type: bool 304 - Default: false 305 306 #### --ftp-disable-utf8 307 308 Disable using UTF-8 even if server advertises support. 309 310 Properties: 311 312 - Config: disable_utf8 313 - Env Var: RCLONE_FTP_DISABLE_UTF8 314 - Type: bool 315 - Default: false 316 317 #### --ftp-writing-mdtm 318 319 Use MDTM to set modification time (VsFtpd quirk) 320 321 Properties: 322 323 - Config: writing_mdtm 324 - Env Var: RCLONE_FTP_WRITING_MDTM 325 - Type: bool 326 - Default: false 327 328 #### --ftp-force-list-hidden 329 330 Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. 331 332 Properties: 333 334 - Config: force_list_hidden 335 - Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN 336 - Type: bool 337 - Default: false 338 339 #### --ftp-idle-timeout 340 341 Max time before closing idle connections. 342 343 If no connections have been returned to the connection pool in the time 344 given, rclone will empty the connection pool. 345 346 Set to 0 to keep connections indefinitely. 347 348 349 Properties: 350 351 - Config: idle_timeout 352 - Env Var: RCLONE_FTP_IDLE_TIMEOUT 353 - Type: Duration 354 - Default: 1m0s 355 356 #### --ftp-close-timeout 357 358 Maximum time to wait for a response to close. 359 360 Properties: 361 362 - Config: close_timeout 363 - Env Var: RCLONE_FTP_CLOSE_TIMEOUT 364 - Type: Duration 365 - Default: 1m0s 366 367 #### --ftp-tls-cache-size 368 369 Size of TLS session cache for all control and data connections. 370 371 TLS cache allows to resume TLS sessions and reuse PSK between connections. 372 Increase if default size is not enough resulting in TLS resumption errors. 373 Enabled by default. Use 0 to disable. 374 375 Properties: 376 377 - Config: tls_cache_size 378 - Env Var: RCLONE_FTP_TLS_CACHE_SIZE 379 - Type: int 380 - Default: 32 381 382 #### --ftp-disable-tls13 383 384 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) 385 386 Properties: 387 388 - Config: disable_tls13 389 - Env Var: RCLONE_FTP_DISABLE_TLS13 390 - Type: bool 391 - Default: false 392 393 #### --ftp-shut-timeout 394 395 Maximum time to wait for data connection closing status. 396 397 Properties: 398 399 - Config: shut_timeout 400 - Env Var: RCLONE_FTP_SHUT_TIMEOUT 401 - Type: Duration 402 - Default: 1m0s 403 404 #### --ftp-ask-password 405 406 Allow asking for FTP password when needed. 407 408 If this is set and no password is supplied then rclone will ask for a password 409 410 411 Properties: 412 413 - Config: ask_password 414 - Env Var: RCLONE_FTP_ASK_PASSWORD 415 - Type: bool 416 - Default: false 417 418 #### --ftp-socks-proxy 419 420 Socks 5 proxy host. 421 422 Supports the format user:pass@host:port, user@host:port, host:port. 423 424 Example: 425 426 myUser:myPass@localhost:9005 427 428 429 Properties: 430 431 - Config: socks_proxy 432 - Env Var: RCLONE_FTP_SOCKS_PROXY 433 - Type: string 434 - Required: false 435 436 #### --ftp-encoding 437 438 The encoding for the backend. 439 440 See the [encoding section in the overview](/overview/#encoding) for more info. 441 442 Properties: 443 444 - Config: encoding 445 - Env Var: RCLONE_FTP_ENCODING 446 - Type: Encoding 447 - Default: Slash,Del,Ctl,RightSpace,Dot 448 - Examples: 449 - "Asterisk,Ctl,Dot,Slash" 450 - ProFTPd can't handle '*' in file names 451 - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" 452 - PureFTPd can't handle '[]' or '*' in file names 453 - "Ctl,LeftPeriod,Slash" 454 - VsFTPd can't handle file names starting with dot 455 456 #### --ftp-description 457 458 Description of the remote 459 460 Properties: 461 462 - Config: description 463 - Env Var: RCLONE_FTP_DESCRIPTION 464 - Type: string 465 - Required: false 466 467 {{< rem autogenerated options stop >}} 468 469 ## Limitations 470 471 FTP servers acting as rclone remotes must support `passive` mode. 472 The mode cannot be configured as `passive` is the only supported one. 473 Rclone's FTP implementation is not compatible with `active` mode 474 as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). 475 This will likely never be supported due to security concerns. 476 477 Rclone's FTP backend does not support any checksums but can compare 478 file sizes. 479 480 `rclone about` is not supported by the FTP backend. Backends without 481 this capability cannot determine free space for an rclone mount or 482 use policy `mfs` (most free space) as a member of an rclone union 483 remote. 484 485 See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) 486 487 The implementation of : `--dump headers`, 488 `--dump bodies`, `--dump auth` for debugging isn't the same as 489 for rclone HTTP based backends - it has less fine grained control. 490 491 `--timeout` isn't supported (but `--contimeout` is). 492 493 `--bind` isn't supported. 494 495 Rclone's FTP backend could support server-side move but does not 496 at present. 497 498 The `ftp_proxy` environment variable is not currently supported. 499 500 ### Modification times 501 502 File modification time (timestamps) is supported to 1 second resolution 503 for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. 504 The `VsFTPd` server has non-standard implementation of time related protocol 505 commands and needs a special configuration setting: `writing_mdtm = true`. 506 507 Support for precise file time with other FTP servers varies depending on what 508 protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` 509 extensions are present, rclone will use them together to provide precise time. 510 Otherwise the times you see on the FTP server through rclone are those of the 511 last file upload. 512 513 You can use the following command to check whether rclone can use precise time 514 with your FTP server: `rclone backend features your_ftp_remote:` (the trailing 515 colon is important). Look for the number in the line tagged by `Precision` 516 designating the remote time precision expressed as nanoseconds. A value of 517 `1000000000` means that file time precision of 1 second is available. 518 A value of `3153600000000000000` (or another large number) means "unsupported".