$ ssh -T git@git***.com ssh: connect to host ssh.git***.com port 22: Connection timed out

输入ssh -T git@git***.com

报错

$ ssh -T git@git***.com ssh: connect to host ssh.git***.com 
port 22: Connection timed out

解决

打开存放 .ssh 的目录,在命令行输入:cd ~/.ssh文件夹里面的点击Git Bash Here

 然后使用命令

vim config

vim config步骤config文件

config文件的内容为

Host git***.com
User git
Hostname ssh.git***.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

然后 ESC 退出,输入:wq,即可保存并退出,创建config成功

 再次尝试

 ssh -T git@git***.com

 这样即为成功

猜你喜欢

转载自blog.csdn.net/qq_35353972/article/details/127502673