CentOS 7.3执行git clone时卡在正克隆到'XXXXXX'

# git clone git@github.com:XXX/XXXXXX.git 正克隆到 'XXXXXX'... ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

错误:到github.com:22连接超时

原因:22端口无法使用

解决方法:修改为443端口

# sudo vim ~/.ssh/config

Host github.com User username@gmail.com Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443

# git clone git@github.com:MocyRee/XXXXXX.git 正克隆到 'XXXXXX'... The authenticity of host '[ssh.github.com]:443 ([192.30.253.122]:443)' can't be established. RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[ssh.github.com]:443,[192.30.253.122]:443' (RSA) to the list of known hosts. remote: Enumerating objects: 153, done. remote: Counting objects: 100% (153/153), done. remote: Compressing objects: 100% (109/109), done. remote: Total 153 (delta 44), reused 150 (delta 41), pack-reused 0 接收对象中: 100% (153/153), 187.70 KiB | 113.00 KiB/s, done. 处理 delta 中: 100% (44/44), done.

问题解决!