AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1083667
Accepted
Petr Javorik
Petr Javorik
Asked: 2021-11-16 23:41:39 +0800 CST2021-11-16 23:41:39 +0800 CST 2021-11-16 23:41:39 +0800 CST

rsync 通过多路 SSH 连接和多个 jumphosts

  • 772

我需要通过多个跳转主机将文件从远程主机同步到我的本地机器。我想使用共享 SSH 连接,这样我就不必在某些跳转主机上多次提交 2FA。

这个想法是我创建一个主连接

ssh user@jumphost01

然后是其他连接

ssh -J user@jumphost01,user@jumphost02 root@target01
...

共享连接控制文件~/.ssh/如下

control:target01:22:root
control:jumphost01:22:user
control:jumphost02:22:user

现在我希望我可以使用 rsync 远程文件

rsync -azv -e 'ssh -o ControlMaster=auto' root@target:/somePath/someFile someFile
or
rsync -azv root@target:/somePath/someFile someFile
or    
rsync -azv -e 'ssh -F /root/.ssh/config' root@target:/somePath/someFile someFile

但我收到 rsync 错误

receiving incremental file list
someFile
WARNING: someFile failed verification -- update discarded (will try again).
someFile
ERROR: someFile failed verification -- update discarded.

sent 68 bytes  received 317 bytes  770.00 bytes/sec
total size is 305  speedup is 0.79
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1819) [generator=3.2.3]

rsync 能够连接到目标,但文件传输不成功。

rsync 版本

local machine - rsync  version 3.2.3  protocol version 31
target machine - rsync  version 3.2.3  protocol version 31

TLDR;

我在没有 SSH 主连接的情况下测试了 rsync 命令

rsync -azv -e 'ssh -J user@jumphost01,user@jumphost02' root@target01:someFile .
One-time password (OATH) for `user': 
Password: 
receiving incremental file list
someFile
WARNING: someFile failed verification -- update discarded (will try again).
someFile
ERROR: someFile failed verification -- update discarded.

sent 68 bytes  received 2,767 bytes  195.52 bytes/sec
total size is 18,976  speedup is 6.69
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1819) [generator=3.2.3]

并且仍然得到相同的错误。

linux bash ssh rsync
  • 1 1 个回答
  • 294 Views

1 个回答

  • Voted
  1. Best Answer
    Petr Javorik
    2021-12-02T00:30:33+08:002021-12-02T00:30:33+08:00

    动态链接库存在一些问题。

    # apt update && apt upgrade
    

    在远程机器上解决了这个问题。

    • 0

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve