【问题标题】:Unable to negotiate with server when running ssh pass in ansible在ansible中运行ssh pass时无法与服务器协商
【发布时间】:2022-01-22 21:31:50
【问题描述】:

我在使用 ansible 时遇到了这个问题。我的目标是运行以下命令:

      ```sshpass -p {{ pass }} sftp -r {{ user }} @sftp.server.com:srcdir/* targetdir```
    
      ```sshpass -p {{ pass }} sftp -r {{ user }} @sftp.server.com:srcdir/* targetdir``` 

user@sftp.server.com:srcdir/* targetdir
Connected to sftp.server.com

Fetching ....

Fetching ....

Fetching ....

当我运行命令时它可以工作,但是当我使用 ansible 来执行它时,它会失败并出现以下错误:

ansible -m shell -a 'sshpass -p {{ pass }} sftp -r {{ user }} @sftp.server.com:srcdir/* targetdir ' 测试 测试 |失败 | rc=255 >> 无法与 IP 端口 22 协商:找不到匹配的 MAC。他们的报价:hmac-sha1,hmac-sha2-256,hmac-sha2-512 无法读取数据包:对等非零返回码重置连接

我的 sshd 配置文件有正确的配置

ssh -Q mac
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
hmac-ripemd160
hmac-ripemd160@openssh.com
umac-64@openssh.com
umac-128@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-sha2-512-etm@openssh.com
hmac-md5-etm@openssh.com
hmac-md5-96-etm@openssh.com
hmac-ripemd160-etm@openssh.com
umac-64-etm@openssh.com
umac-128-etm@openssh.com

在ansible上失败有什么原因吗?谢谢!

【问题讨论】:

    标签: ansible


    【解决方案1】:

    我想通了,结果发现我的某些主机确实缺少 MAC,我添加了它们并解决了问题

    【讨论】:

      猜你喜欢
      • 2020-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-09
      • 2020-06-30
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多