Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP: Support active mode #1971

Closed
sinnerliu opened this issue Jan 12, 2018 · 16 comments · Fixed by #5663
Closed

FTP: Support active mode #1971

sinnerliu opened this issue Jan 12, 2018 · 16 comments · Fixed by #5663
Assignees
Projects
Milestone

Comments

@sinnerliu
Copy link

sinnerliu commented Jan 12, 2018

What is your rclone version (eg output from rclone -V)

1.3.9

Which OS you are using and how many bits (eg Windows 7, 64 bit)

centos7.4

Which cloud storage system are you using? (eg Google Drive)

ftp

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount remote_ftp: /tmp/ftppath

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

I hope add PASV and PORT when rclone config ftp . because ftp server only accept PASV;
thinks!

@ncw
Copy link
Member

ncw commented Jan 18, 2018

Rclone FTP uses EPSV mode by default. Which ftp sever are you using and what errors did you get - can you post logs?

@sinnerliu
Copy link
Author

sinnerliu commented Jan 19, 2018

[root@localhost rclone-v1.39-linux-amd64]$ ./rclone -vv ls ftp125:
2018/01/19 10:04:43 DEBUG : Using config file from "/home/root/.config/rclone/rclone.conf"
2018/01/19 10:04:43 DEBUG : rclone: Version "v1.39" starting with parameters ["./rclone" "-vv" "ls" "ftp125:"]
2018/01/19 10:04:43 DEBUG : ftp://11.51.11.125:21: Connecting to FTP server
2018/01/19 10:04:45 INFO : ftp://11.51.11.125:21: Modify window not supported
2018/01/19 10:05:46 ERROR : : error listing: dial tcp 11.51.11.125:50276: i/o timeout
2018/01/19 10:05:46 Failed to ls: dial tcp 11.51.11.125:50276: i/o timeout

but use ftp command is ok:

[root@localhost ~]# ftp -i -n
ftp> open 11.51.11.125
Connected to 10.5.11.125 (11.51.11.125).
220 Xlight FTP 3.7 ...
Remote system type is UNIX:.
ftp> user 123 123
331 123
230
ftp> ls
227 Entering Passive Mode (11,51,11,125,197,163)
^C
receive aborted
waiting for remote to finish abort
ftp> passive
Passive mode off.
ftp> ls
200 PORTִ150 ģʽΪ /bin/ls (165 ).
drw-rw-rw- 1 ftp ftp 0 Sep 27 2017 .
drw-rw-rw- 1 ftp ftp 0 Sep 27 2017 ..
drw-rw-rw- 1 ftp ftp 0 Sep 27 2017 i2p
226 (1.031 KB/s).
ftp>

@ncw
Copy link
Member

ncw commented Jan 19, 2018

Passive mode off.

Ah, you are using active mode...

Unfortunately the ftp library I'm using doesn't support active mode: jlaffaye/ftp#29

@ncw ncw changed the title Add PASV and PORT when rclone config ftp FTP: Support active mode Jan 19, 2018
@sinnerliu
Copy link
Author

thinks ,I will wait for rclone support active mode

@ncw ncw added this to the Help Wanted milestone Aug 30, 2018
@rvalitov
Copy link

This issue is not fixed yet?

@ncw
Copy link
Member

ncw commented Mar 16, 2020

This issue is not fixed yet?

It needs a volunteer to add it to jlaffaye/ftp#29

@rajeshgoyalg
Copy link

This issue is not yet fixed. And I am getting error "Failed to copy: Put mkParentDir failed: EOF" while rclone copy.
https://forum.rclone.org/t/rclone-copy-to-ftp-error-with-put-mkparentdir-failed/21674

@BraINstinct0
Copy link

since Improve FTP is planned, it might be worth being put on the list @ivandeex ?

@ivandeex
Copy link
Member

ivandeex commented Aug 26, 2021

All improvements are planned for passive mode only and include:

  • reliable transfer of large files
  • TLS compatibility improvements
  • TLS session resumption
  • 1sec modtime resolution
  • path encoding for proftp/pureftp/vsftp
  • mitigations for missing about
  • mitigations for missing hashsum

Active mode means "rclone requests a transfer, opens incoming port, then ftp server connects back and performs the transfer".
I will not work on this.

This mode is insecure. Actually I think we don't need it at all. I'd rather close out this feature request if @ncw agrees.

@ivandeex
Copy link
Member

ivandeex commented Aug 26, 2021

The only fix I can provide for this ticket, will be a documentation fix saying
rclone will not support ftp active mode due to security concerns. please revert to other tools.
cc @ncw

@BraINstinct0
Copy link

Umm, but isn't active mode more secure(well ftp itself is insecure)? Since it requires bidirectional communication the server has more control on connection

@ivandeex
Copy link
Member

ivandeex commented Aug 26, 2021

It makes rclone insecure because rclone has to open incoming ports on its own machine to support active connections from ftp server.
Upd... putting rclone and the box it runs on under control of ftp server, so to say

@ivandeex ivandeex self-assigned this Aug 26, 2021
@ivandeex
Copy link
Member

ivandeex commented Aug 26, 2021

well ftp itself is insecure

Modern FTP servers support TLS on command and data connections.
Some of them have option to require data connections to provide pre-shared TLS keys (PSK) negotiated in advance on command connection (aka TLS resumption) as a way to additionally "authenticate" data stream.

I am going to make rclone support that. Again, in passive mode (no open ports on rclone side!).

@BraINstinct0
Copy link

BraINstinct0 commented Aug 26, 2021

In that case I can agree that security on rclone's side is enhanced by using passive mode. (Yes it seems to be easier to implement too). I believe your choice is totally reasonable in that sense. (TBH almost nobody use active mode!)

@ncw
Copy link
Member

ncw commented Aug 29, 2021

The only fix I can provide for this ticket, will be a documentation fix saying
rclone will not support ftp active mode due to security concerns. please revert to other tools.
cc @ncw

I have used active mode a few times but not for at least 15 years. Its useful when the FTP server you are trying to connect to is behind a firewall that doesn't accept arbitrary incoming ports and doesn't snoop the FTP protocol to read which ports it should open.

FTP is a disaster area for security - passive mode for the server, active mode for the client.

@BraINstinct0 - do you have a use case for Active mode FTP?

As far as rclone support, I'd stand by my original comment

It needs a volunteer to add it to jlaffaye/ftp#29

So I'd probably re-word your text slightly @ivandeex

We have this at the moment

FTP servers acting as rclone remotes must support 'passive' mode. Rclone's FTP implementation is not compatible with 'active' mode.

How about

FTP servers acting as rclone remotes must support 'passive' mode. Rclone's FTP implementation is not compatible with 'active' mode as the library it uses doesn't support it. This will likely never be supported due to security concerns.

@ivandeex ivandeex added this to To do in ftp Oct 4, 2021
@ivandeex
Copy link
Member

ivandeex commented Oct 4, 2021

As far as rclone support, I'd stand by my original comment

It needs a volunteer to add it to jlaffaye/ftp#29

I will add this text together with the link to the https://rclone.org/ftp

@ivandeex ivandeex moved this from To do to In progress in ftp Oct 5, 2021
@ivandeex ivandeex linked a pull request Oct 5, 2021 that will close this issue
5 tasks
@ivandeex ivandeex moved this from In progress to Done in ftp Oct 5, 2021
@ivandeex ivandeex modified the milestones: Help Wanted, v1.57 Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
ftp
Done
Development

Successfully merging a pull request may close this issue.

6 participants