Gitlab CI/CD can't connect to my remote vps. I took https://gitlab.com/gitlab-examples/ssh-private-key as an example to make a .gitlab-ci.yaml file, its contents:
image: ubuntu
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
- eval $(ssh-agent -s)
- echo "$SSH_KEY_VU2NW" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan (domain name here) >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
Test SSH:
script:
- ssh root@(IP address here)
The runner responds with
the connection is refused
The server auth log says
sshd[2222]: Unable to negotiate with XXXXX port 53068: no matching host key type found. Their offer: sk-ecdsa-sha2-nistp256@openssh.com [preauth]
sshd[2220]: Unable to negotiate with XXXXX port 53068: no matching host key type found. Their offer: sk-ssh-ed25519@openssh.com [preauth]
Is there any way to solve this? I already tried connecting to another VPS, also without luck.