duplicity.backends.ssh_paramiko_backend module

class duplicity.backends.ssh_paramiko_backend.SSHParamikoBackend(parsed_url)[source]

Bases: Backend

This backend accesses files using the sftp or scp protocols. It does not need any local client programs, but an ssh server and the sftp program must be installed on the remote side (or with scp, the programs scp, ls, mkdir, rm and a POSIX-compliant shell).

Authentication keys are requested from an ssh agent if present, then ~/.ssh/id_rsa/dsa are tried. If -oIdentityFile=path is present in –ssh-options, then that file is also tried. The passphrase for any of these keys is taken from the URI or FTP_PASSWORD. If none of the above are available, password authentication is attempted (using the URI or FTP_PASSWORD).

Missing directories on the remote side will be created.

If scp is active then all operations on the remote side require passing arguments through a shell, which introduces unavoidable quoting issues: directory and file names that contain single quotes will not work. This problem does not exist with sftp.

__init__(parsed_url)[source]
_delete(filename)[source]
_get(remote_filename, local_path)[source]
_list()[source]
_put(source_path, remote_filename)[source]
gethostconfig(file, host)[source]
runremote(cmd, ignoreexitcode=False, errorprefix='')[source]

small convenience function that opens a shell channel, runs remote command and returns stdout of command. throws an exception if exit code!=0 and not ignored