Search code examples
sshtravis-cidigital-oceansshd

scp transfer with travis-ci


trying to deploy to Digital Ocean from travis, keep getting

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

on the host.

Tried adding lots of things to the .travis.yml most recently

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

But no love. that just gets me

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

So, seems like an issue with a shiny new openssl, and travis being an old version?

I'm using a private key of course, that all seems to be working fine.

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

Solution

  • Quite possibly. I can't list the supported key types on Precise image (because it is too old and does not support the -Q flag).

    However, I have confirmed that the Trusty image does indeed support ssh-dss key. And this is enabled by default. I don't have a server to test with, but you should be able to move forward with:

    dist: trusty
    

    See https://docs.travis-ci.com/user/reference/trusty/ for more info.