物理机服务器,安装git
之后,想从github
上clone
自己的项目运行,ssh key
已经配置过, 但在执行git clone
命令时出现了如下报错:
1 | ssh: connect to host github.com port 22: Connection timed out |
解决方案
在系统~/.ssh
目录下执行touch config
命令新建config
文件,并修改文件权限:
1 | sudo chmod 600 config |
然后在config
文件中添加如下内容:
1 | Host github.com |
然后设置:
1 | git config --global user.name "XXX" |
此时再去执行git clone
命令,一切正常。