重复性取决于“ ssh:切换到新键...”

时间:2018-10-19 04:22:48

标签: ssh backup scp duplicity

我想使用重复性0.7.06(通过apt在Ubuntu 16.04.5 LTS上安装)将本地目录备份到远程服务器。在远程服务器上设置了一个~/.ssh/authorized_keys文件的用户帐户。

双重性命令行如下:

duplicity full --verbosity debug /local/folder scp://remoteuser@remotehost/backup

双重性的调试输出是:

Using archive dir: /foo/bar/.cache/duplicity/bedacf3ab67835c3d614d3773c672c53
Using backup name: bedacf3ab67835c3d614d3773c672c53
Import of duplicity.backends.azurebackend Succeeded
Import of duplicity.backends.b2backend Succeeded
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cfbackend Succeeded
Import of duplicity.backends.copycombackend Succeeded
Import of duplicity.backends.dpbxbackend Succeeded
Import of duplicity.backends.gdocsbackend Succeeded
Import of duplicity.backends.giobackend Succeeded
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.hubicbackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.lftpbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.megabackend Succeeded
Import of duplicity.backends.multibackend Succeeded
Import of duplicity.backends.ncftpbackend Succeeded
Import of duplicity.backends.onedrivebackend Succeeded
Import of duplicity.backends.par2backend Succeeded
Import of duplicity.backends.pydrivebackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.ssh_paramiko_backend Succeeded
Import of duplicity.backends.ssh_pexpect_backend Succeeded
Import of duplicity.backends.swiftbackend Succeeded
Import of duplicity.backends.sxbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
ssh: starting thread (client mode): 0x5e398850L
ssh: Local version/idstring: SSH-2.0-paramiko_1.16.0
ssh: Remote version/idstring: SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u3
ssh: Connected (version 2.0, client OpenSSH_7.4p1)
ssh: kex algos:[u'curve25519-sha256', u'curve25519-sha256@libssh.org', u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group16-sha512', u'diffie-hellman-group18-sha512', u'diffie-hellman-group14-sha256', u'diffie-hellman-group14-sha1'] server key:[u'ssh-rsa', u'rsa-sha2-512', u'rsa-sha2-256', u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com', u'aes256-gcm@openssh.com'] server encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com', u'aes256-gcm@openssh.com'] client mac:[u'umac-64-etm@openssh.com', u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com', u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com', u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] server mac:[u'umac-64-etm@openssh.com', u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com', u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com', u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] client compress:[u'none', u'zlib@openssh.com'] server compress:[u'none', u'zlib@openssh.com'] client lang:[u''] server lang:[u''] kex follows?False
ssh: Kex agreed: diffie-hellman-group-exchange-sha256
ssh: Cipher agreed: aes128-ctr
ssh: MAC agreed: hmac-sha2-256
ssh: Compression agreed: none
ssh: Got server p (2048 bits)
ssh: kex engine KexGexSHA256 specified hash_algo <built-in function openssl_sha256>
/usr/lib/python2.7/dist-packages/Crypto/Cipher/blockalgo.py:141: FutureWarning: CTR mode needs counter parameter, not IV
  self._cipher = factory.new(key, *args, **kwargs)
ssh: Switch to new keys ...

等待一会儿后,又出现一行:

ssh: EOF in transport thread

我可以通过SSH手动连接到远程服务器,而无需使用以下命令指定密码:

ssh remoteuser@remotehost

我也可以通过scp复制文件而无需指定密码:

scp /some/file remoteuser@remotehost:/home/remoteuser/backup

所以这似乎是双重性或paramiko问题。

根据“ SSH后端注意事项”手册部分,我在duplicity命令行中尝试了各种SSH后端:

paramiko + scp

导致上述问题。

paramiko + sftp

导致上述问题。

pexpect + scp

ImportError: No module named pexpect

pexpect + sftp

ImportError: No module named pexpect

lftp + scp:

这在安装lftp之后有效,但是,它需要密码认证,并且授权密钥无法按预期工作。

1 个答案:

答案 0 :(得分:3)

paramiko 1.16和双重性0.7.06相当老。尝试升级到最新版本(paramiko 1.18.x或2.4.x以及重复性0.7.18.x),看看问题是否解决。闻起来就像是paramiko问题。

如果没有,请安装python-pexpect并通过openssh二进制文件使用ssh后端,如果它在命令行上正常运行,则应该可以正常工作。

.. ede / duply.net