首页 > 解决方案 > Gitlab SSH在花费一些时间后给出连接超时错误

问题描述

我在通过 SSH 访问 Gitlab 时遇到问题。它工作正常,直到一周前 gitlab 操作停止工作并且在花费大量时间后给出连接超时错误。我阅读了类似的问题,他们建议通过运行命令进行检查ssh -Tv git@gitlab.com,我得到的输出是

OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /home/emumba/.ssh/id_gitlab type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/emumba/.ssh/id_gitlab-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3

它卡在这一点上。我已经尝试添加一个新密钥,但它仍然不起作用。HTTPS 工作正常,但我需要使用 SSH

标签: gitsshgitlab

解决方案


首先检查网络中不同工作站的问题是否仍然存在(假设是企业设置)。

对于个人家庭设置,考虑到连接已建立,不应该有任何防火墙问题。
然后检查您的环境变量是否有任何与 SSH 相关的内容:

env|grep -i SSH
git config -l | grep -i ssh

推荐阅读