github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

1. 异常



在连接github时,执行”ssh -T [email protected]” 命令时,出现

ssh: connect to host github.com port 22: Connection timed out
  • 1

2. 解决方法



在存放公钥私钥(id_rsa和id_rsa.pub)的文件里,新建config文本,内容如下:

Host github.comUser YourEmail@163.comHostname ssh.github.comPreferredAuthentications publickeyIdentityFile ~/.ssh/id_rsaPort 443
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

其中User为登录github的账号名称。
再次执行”ssh -T [email protected]”时,会出现提示如下,回车”yes”即可。

这时验证就可以通过。

时间: 2024-08-24 05:05:21

github连接报"ssh: connect to host github.com port 22: Connection timed out"错误的相关文章

git clone遇到的[ssh: connect to host github.com port 22]

起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C "[email protected]"可参考-远程仓库.第一步:ssh-keygen -t rsa -C "[email protected]":第二步:在用户目录下,找到.ssh文件夹下的id_rsa.pub,打开先复制全部内容:第三步:登录github,个人帐号se

ssh: connect to host github.com port 22: Connection refused

假设git例如,下面的问题时,远程推送: [[email protected] learngit]$ git push -u origin master ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository. Please make sure you have the correct access rights and the reposit

github默认端口22被占用,ssh: connect to host github.com port 22: Connection timed out

出现github 连接错误: ssh:connect to host github.com port 22:Connection timed out 刚开始以为是网络问题,github不能连接上,但是使用ssh命令,用端口443测试发现可以连接上github ssh -T -p 443 [email protected] Enter passphrase for key '/root/.ssh/id_rsa': Hi yinfei1! You've successfully authentica

【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法

  场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. 错误现象:在场景运行时出现大量Action.c(8): Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误. 官方的troubleshooting: 查看工具的tro

$ ssh -T [email protected] ssh: connect to host ssh.github.com port 22: Connection timed out

在C:/用户/用户名/.ssh中添加几个文件 之前的电脑生成都是四个文件,分别是 id_rsa  id_rsa.pub  config known_hosts 不知道为什么在另一台电脑上却生成两个文件  id_rsa  id_rsa.pub 原来这两个文件也能使用,只不过最近在研究git,发现clone失败,SSH key不能连接. 无奈只能添加两个文件如下: config Host github.com User git Hostname ssh.github.com PreferredAut

ssh: connect to host IPADDR port 22: Connection timed out on ubuntu

可以从以下几个方面检查 1 vi /etc/ssh/sshd_config: 然后将这两项的注释号去掉 Port 22 Protocol 2 2 检查sshd服务 sudo service ssh status. 3 检查名字是否一致 /etc/hostname, and /etc/hosts. 4 检查防火墙. sudo service ufw status 5 查看tcp端口22 [email protected]:~$ netstat -nat | grep :22 tcp       

Git配置非22端口,解决:ssh: connect to host xxx port 22: Connection timed out fatal: The remote end hung up unexpectedly

背景:私自搭建了Git服务器,而Git本身就是SSH进行连接的,而Git命令上默认只能通过22端口实现. 解决方法: 第一种: 在系统的用户目录下的文件夹:.ssh 如果该路径下没有config文件,则创建一个. config中添加如下内容: 如是以域名访问的则添加如下内容:(注意修改xxx为你的远程仓库的名称) Host xxx HostName xxx.com Port 3333 如是以IP访问的,则添加如下内容:(注意修改IP为你的远程仓库IP) Host "211.111.xx.xxx&

服务器22端口连接超时 ssh: connect to host *** port 22: Operation timed out

最近酸酸乳出问题,连接v社服务器发现碰到 ssh: connect to host master port 22: Connection timed out 的问题.现在对该问题做一下可能出现的问题 的总结和解决办法: 一.IP配置错误. 当出现上述错误时,首先检查网络连通情况,Ping一下远程登录的目标主机,如果ping不通,很有可能 是/etc/hosts文件中的IP地址映射出现问题,需要仔细检查名称和IP地址的映射关系. 二.防火墙问题. 当发现IP配置没有错误时,我们需要检查端口是否被防

hadoop启动start-all.sh出错(master: ssh: connect to host master port 22: Connection refused)

当我们打开系统输入hadoop启动命令start-all.sh时出现以下错误: [[email protected] ~]# start-all.sh starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-root-namenode-master.out master: ssh: connect to host master port 22: Network is unreachable master: ss