SAR*_*SYR 6 linux git ssh github gitlab
我无法在 git 中 ssh 到 github、bitbucket 或 gitlab。
我通常会收到以下错误消息:如何避免它?
==========输出============
ssh -T git@github.com -i ~/.ssh/id_rsa -v
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: connect to address 192.30.255.113 port 22: Connection timed out
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: connect to address 192.30.255.112 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
Run Code Online (Sandbox Code Playgroud)
此错误消息的典型情况是
OP 确认 ISP 已阻止端口 22。
看看是否可以使用 https 网址来代替:
cd /path/to/my/local/repo
git remote set-url origin https://github.com/<user>/<repo>
Run Code Online (Sandbox Code Playgroud)
单击安全组选项卡,单击编辑规则,然后添加几个规则:
imcp, from port: -1, to port: -1, cidr: 0.0.0.0/0
tcp, from port: 22, to port: 22, cidr: your.ip.address.here/32
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10435 次 |
| 最近记录: |