【发布时间】:2018-01-28 10:46:30
【问题描述】:
第一次使用 GitHub。
在 github.com 上创建了存储库。现在我想推送到那个存储库。出现“连接失败”错误。
当我运行“ssh -Tv git@github.com”时,我得到“connection timed out”。
并且“ssh -T -p 443 git@ssh.github.com”失败:Permission denied。
我关闭了 Windows 防火墙。同样的错误。
怎么办?如何连接到 GitHub?
我正在使用 VSCode。从 powershell 命令行工作。
这是我尝试过的命令:
PS C:\gitsteve\maker> ssh -Tv git@github.com
OpenSSH_7.1p2, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: connect to address 192.30.255.112 port 22: Connection timed out
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: connect to address 192.30.255.113 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
PS C:\gitsteve\maker> git push -u origin master
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.
PS C:\gitsteve\maker> ssh -T -p 443 git@ssh.github.com
The authenticity of host '[ssh.github.com]:443 ([192.30.253.123]:443)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.253.123]:443' (RSA) to the list of known hosts.
Permission denied (publickey).
PS C:\gitsteve\maker> ssh-add -l
Could not open a connection to your authentication agent.
PS C:\gitsteve\maker> ssh -T -p 443 git@ssh.github.com
Warning: Permanently added the RSA host key for IP address '[192.30.253.122]:443' to the list of known hosts.
Permission denied (publickey).
Please make sure you have the correct access rights
and the repository exists.
PS C:\gitsteve\maker> ssh-agent -s
SSH_AUTH_SOCK=/tmp/ssh-W7z0JBkeNSBz/agent.14164; export SSH_AUTH_SOCK;
SSH_AGENT_PID=14148; export SSH_AGENT_PID;
echo Agent pid 14148;
PS C:\gitsteve\maker> ssh-add -l -E md5
Could not open a connection to your authentication agent.
PS C:\gitsteve\maker> ssh -T -p 443 git@ssh.github.com
Permission denied (publickey).
【问题讨论】:
-
更多信息。 git push -u origin master 命令在 github 桌面应用程序的 git shell 中工作。