ssh: connect to host github.com port 22: Connection timed out
1. 检查SSH是否连接成功
ssh -T git@github.com
# 报错
ssh: connect to host github.com port 22: Connection timed out
2. 配置文件
-
新建
config
文件 -
编辑配置文件
Host github.com User YourEmail@163.com #只需要改邮箱 Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443
-
执行
ssh -T git@github.com
,输入yes
即可。
之后就能上传代码了。
git push 权限
1. 生成token
-
Goto settings of Github account
-
Find and Select Developer Settings
-
Find and Select Personal access tokens
-
Generate a new token
-
Fill in any note and select the access scopes
-
once done click on generate token
2. 新增Windows凭证