Duplicity does not work with lftp+ftps backend

803 Views Asked by At

Trying to backup Ubuntu 18.04.1 server using duplicity to a FTPS (FTP over SSL) server. The password is stored in the FTP_PASSWORD environment variable as suggested. The duplicity command is:

duplicity /path/to/backup ftps://user@hostname/some/dir

The problem is that this translates into the following when it turns around and calls lftp

open -u 'user,pass` ftps://hostname

This will not work until you change the open command to (without the ftps:// prefix on the hostname:

open -u 'user,pass` hostname

What I cannot figure out is either:

  • How to tell duplicity not to build up the open command with the ftps:// prefix.
  • How to get lftp to work with the prefix

Note: The FTPS server works fine with other FTP clients, and even works properly with lftp as long as I build up the open command correctly.

2

There are 2 best solutions below

3
On

that seems wrong, https://lftp.yar.ru/lftp-man.html clearly states urls are viable

   open [OPTS] site

   Select  a  server  by host name, URL or bookmark. When an URL or bookmark
   is given, automaticallycally change the current working directory to the
   directory of the URL.  Options:

   ...
        --user user       use the user for authentication
        --password pass   use the password for authentication
        --env-password    take password from LFTP_PASSWORD environment variable
        site              host name, URL or bookmark name

also

   cmd:default-protocol (string)
          The value is used when `open' is used with just host name without
          protocol. Default is `ftp'.

so removing ftps:// simply makes lftp connect via ftp which is probably not what you want.

i'd suggest you to enable duplicity max. verbosity '-v9' and find out why lftp fails to connect via ftps://

..ede/duply.net

0
On

I had the same problem that lftp worked fine with ftps when I just wrote the hostname. Duplicity whereas did fail with some TLS unexpected packet errors.

Solution was: instead of writing ftps:// write ftpes://

duplicity /path/to/backup ftpes://user@hostname/some/dir

This changes how and when credentials will be encrypted by lftp.