gpt4 book ai didi

linux - Gitlab 自动部署已停止工作,服务器日志中出现 "no matching host key type found"错误

转载 作者:行者123 更新时间:2023-12-04 13:51:37 26 4
gpt4 key购买 nike

我有 .gitlab-ci.yml:

image: php:latest
deploy:
stage: deploy
only:
- master
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_KEY" | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_HOST > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh $SSH_USER@$SSH_HOST "cd $SSH_PATH && git pull origin master"
它工作了几个月,但大约一周前停止工作,尽管服务器上没有任何变化。
管道失败作业日志:
# mydomainproject.com:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
$ chmod 644 ~/.ssh/known_hosts
$ ssh $SSH_USER@$SSH_HOST "cd $SSH_PATH && git pull origin master"
ssh: connect to host mydomainproject.com port 22: Connection refused
Cleaning up file based variables
ERROR: Job failed: exit code 1
服务器上的/var/log/auth.log:
sshd[23927]: Connection closed by 35.227.7.98 port 50036 [preauth]
sshd[23925]: Connection closed by 35.227.7.98 port 50038 [preauth]
sshd[23924]: Connection closed by 35.227.7.98 port 50040 [preauth]
sshd[23928]: Unable to negotiate with 35.227.7.98 port 50042: no matching host key type found. Their offer: sk-ecdsa-sha2-nistp256@openssh.com [preauth]
sshd[23926]: Unable to negotiate with 35.227.7.98 port 50044: no matching host key type found. Their offer: sk-ssh-ed25519@openssh.com [preauth]
我已阅读 this并尝试编辑 .gitlab-ci.yml:
script:
- ssh -oHostKeyAlgorithms=+sk-ecdsa-sha2-nistp256@openssh.com $SSH_USER@$SSH_HOST "cd $SSH_PATH && git pull origin master"
它没有帮助,结果是一样的。
我不明白出了什么问题以及为什么它停止工作。

最佳答案

您是否也尝试过 ssh -oHostKeyAlgorithms=+ssh-dss ?
这是 OpenSSH 旧版 documentation 中描述的已知问题。即使出于安全原因不建议使用此解决方法。

关于linux - Gitlab 自动部署已停止工作,服务器日志中出现 "no matching host key type found"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68926661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com