ssh: connect to host gitlab.com port 22: Connection timed out

不知为何 gitlab 经常用着用着就出现以下问题:

解决方法:
在自己的用户目录下找到.ssh/文件夹,在里面创建config文件。

在config文件里面添加以下内容:

Host github.com

User git

Hostname ssh.github.com

PreferredAuthentications publickey

IdentityFile ~/.ssh/id_rsa

Port 443

然后在终端执行以下命令:

ssh -T [email protected]

就可以访问gitlab了。

猜你喜欢

转载自blog.csdn.net/Freedom_hzw/article/details/104369874