【问题标题】:scp transfer with travis-ci使用 travis-ci 进行 scp 传输
【发布时间】:2018-01-27 17:36:08
【问题描述】:

尝试从 travis 部署到 Digital Ocean,继续获取

fatal: Unable to negotiate with 52.54.31.11 port 39748: no matching host key type found. Their offer: ssh-dss [preauth]

在主机上。

最近尝试在 .travis.yml 中添加很多东西

before_script:
  - echo -e "Host 159.203.162.79\n\tUser root\n\tIdentityFile /tmp/deploy_rsa\n\tHostKeyAlgorithms +ssh-dss\n" >> ~/.ssh/config

但没有爱。这让我很感动

/home/travis/.ssh/config line 7: Bad protocol 2 host key algorithms '+ssh-dss'.

那么,闪亮的新 openssl 似乎是个问题,而 travis 是旧版本?

当然,我使用的是私钥,一切似乎都可以正常工作。

before_install:
  - openssl aes-256-cbc -K $encrypted_ca03cb1712d9_key -iv $encrypted_ca03cb1712d9_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d && chmod 600 /tmp/deploy_rsa

before_deploy:
  - eval "$(ssh-agent -s)"
  - ssh-add /tmp/deploy_rsa

【问题讨论】:

    标签: ssh travis-ci digital-ocean sshd


    【解决方案1】:

    很有可能。我无法在 Precise 图像上列出支持的键类型(因为它太旧并且不支持 -Q 标志)。

    但是,我已经确认 Trusty 映像确实支持 ssh-dss 密钥。这是默认启用的。我没有要测试的服务器,但您应该可以继续:

    dist: trusty
    

    请参阅https://docs.travis-ci.com/user/reference/trusty/ 了解更多信息。

    【讨论】:

    • 好像就是这样。
    • 我遇到了与 OP 相同的问题,但添加 dist: trusty 并没有解决它。
    • @SethStone 你有构建日志 URL 可以分享吗?如果是同样的问题,dist: trusty 应该修复它。如果dist: trusty 没有,那么您的问题很可能是另一个问题。
    • 好吧,自从我上次发表评论以来,我一直在努力。查看 OP 的帖子,这意味着 Travis 主机 is 提供 ssh-dss 并且数字海洋服务器没有启用它。令人误解的是,Travis 中的“ssh_known_hosts”插件运行 ssh-keyscan,它试图“预认证”服务器以查看可用的密钥和密钥类型。在此过程中,它会尝试发送消息的 DSS,但这并不意味着有任何问题。 [我的实际问题没有那么复杂,我只是在我的 openssl 命令中省略了“-d”标志。 :-| ]
    猜你喜欢
    • 2020-06-15
    • 2016-01-12
    • 1970-01-01
    • 2017-11-12
    • 2016-01-29
    • 2016-08-29
    • 1970-01-01
    • 2015-09-17
    • 2016-08-09
    相关资源
    最近更新 更多