GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)
问题情况
本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去。于是只好用命令行的方式解决。
Tortoisegit上是这样说的:
git.exe push -v --progress "xx" master:master
Pushing to git@github.com:xxx/xxxx.git
ssh: connect to host github.com port 22: Bad file number
fatal: Could not read from remote repository.
git did not exit cleanly (exit code 128)
gitbash上是这样说的
$ git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
尝试解决
通过查询,发现在bash中自己没有授权key,于是按照教程,查询现有的密钥:
ls -al ~/.ssh
clip < ~/.ssh/id_rsa.pub
将现有的id_rsa加入到github网站上,并按照github的官网给的教程,将原有的id_rsa加入到本机的ssh:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
但是运行ssh -T git@github.com
命令还是显示ssh: connect to host github.com port 22: Bad file number
还是没有解决,然后在官网的常见问题中看到了BadFileNumber,有三种方法,1是用https,2是关于防火墙的,看起来比较麻烦,不想弄;3就是用ssh而非https
而我现在用的好像就是https啊,于是再试着用TortoiseGit试一下,还是不行。
那就用第三种方法吧,在~/.ssh/config
文件中增加,但是看看只有config file
而没有Config,于是就拷贝一个重命名为config
,把下面的代码粘贴:
Host github.com
Hostname ssh.github.com
Port 443
就能出现下面的成功授权提示啦~~~
The authenticity of host '[ssh.github.com]:443 ([192.30.253.123]:443)' can't be established.
RSA key fingerprint is .
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.
Hi ! You've successfully authenticated, but GitHub does not provide shell access.
再去push看看,终于成功啦啦啦啦
GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)的更多相关文章
- ssh: connect to host gihub.com port 22: Connection timed out
方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...
- ssh: connect to host github.com port 22: Connection timed out
问题描述 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git Cloning into 'MaugerWu.github.io'... ...
- git clone遇到的[ssh: connect to host github.com port 22]
起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C ...
- github连接报"ssh: connect to host github.com port 22: Connection timed out"错误
1. 异常 在连接github时,执行"ssh -T git@github.com" 命令时,出现 ssh: connect to host github.com port 22: ...
- 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不能连接上,但是 ...
- 关于github报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
当执行git命令如:git clone.git pull等等 出现报错:ssh: connect to host github.com port 22: Connection timed outfat ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误
在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...
- 关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.
今天上午写demo的时候,突然pull不下代码了,报了一下这样情况的错误: 看了一下代码,怀疑是网路错误,因为在这以前一切都正常的,然后将代码复制搜索了一番,解决办法有很多什么配置config啦,gi ...
随机推荐
- js 表单不为空,数字长度验证
$(document).ready(function() { //聚焦第一个输入框 $("#invtype").focus(); ...
- js获取标签的几种方式
一:id获取(全部浏览器兼容) document.getElementById(""); <body> <div id="box">&l ...
- Spring 创建bean的模式
在默认情况下,spring创建bean是单例模式 scope="singleton ",还有一种方式为多例模式[prototype] scope sing ...
- 【模板】【凸包】Graham_scan
/* 唐代李白 <江夏别宋之悌> 楚水清若空,遥将碧海通.人分千里外,兴在一杯中. 谷鸟吟晴日,江猿啸晚风.平生不下泪,于此泣无穷. */ #include <iostream> ...
- 『重构--改善既有代码的设计』读书笔记----Introduce Local Extension
同Introduce Foreign Method一样,很多时候你不能修改编辑原始类,你需要为这些服务类增加一些额外的函数,但你没有这个权限或者入口.如果你只需要一个或者两个外加函数那么你可以放心的使 ...
- centos 安装vnc服务
1.安装tigervnc-server yum install tigervnc-server 2.启动vnc服务 vncserver:1 [错误提示待解决bad display name " ...
- sphinx (coreseek)——3、区段查询 与 增量索引实例
首先本文测试数据100多万的域名的wwwtitle 信息 检索数据: 首先建立临时表格: CREATE TABLE `sph_counter` ( `index_id` ) NOT NULL, `m ...
- php开发学习目录
最近有个项目需要使用php,没办法学习吧 本文不适合没有任何语言的初学者,也不适合 php熟练者.只是个人工作中需要的总结 目录 一.环境安装 1.1 apache 简介安装使用等 1.2 php 5 ...
- 【C语言】字符集和词汇
C语言字符集和词汇 一.相关基础知识 字符是组成语言的最基本的元素 词汇,又称语汇,是一种语言里所有的(或特定范围的)词和固定短语的总和 二.具体内容 C语言字符集由:字母.数字.空格.标点和特殊字符 ...
- EasyUI篇の日期控件
页面代码: <input type="text" id='astartTime' class="easyui-datebox" style="w ...