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 repository exists.

能够採用例如以下方法:

[[email protected] ~]$ vim .ssh/config

Host github.com
User [email protected]
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

測试连接是否成功:

[[email protected] ~]$ ssh -T [email protected]
Hi fulinux! You‘ve successfully authenticated, but GitHub does not provide shell access.

推送:

[[email protected] learngit]$ git push -u origin master
The authenticity of host ‘[ssh.github.com]:443 ([192.30.252.151]:443)‘ can‘t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘[ssh.github.com]:443,[192.30.252.151]:443‘ (RSA) to the list of known hosts.
Counting objects: 23, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (23/23), 1.87 KiB | 0 bytes/s, done.
Total 23 (delta 6), reused 0 (delta 0)
To [email protected]:fulinux/learngit.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

版权声明:本文博主原创文章,博客,未经同意不得转载。

时间: 2024-10-16 17:40:32

ssh: connect to host github.com port 22: Connection refused的相关文章

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.comPreferredAut

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

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 localhost port 22: Connection refused (2)

命令:ssh localhost 错误信息:ssh: connect to host localhost port 22: Connection refused 错误原因: 1.sshd 未安装 2.sshd 未启动 3.防火墙 解决方法: 1.确定安装sshd:  sudo apt-get install openssh-server 2.启动sshd: net start sshd 3.检查防火墙设置 检验方法: 输入命令:ssh localhost 若成功,则表示安装成功,且连接通过: 转

Ubuntu下 ssh : connect to host localhost port 22:Connection refused

Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因可能是ssh-server未安装或者未启动.ubuntu 11.10 默认安装openssh-client,但是木有安装server 运行 ps -e | grep ssh,查看是否有sshd进程 如果没有,说明server没启动,通过 /etc/init.d/ssh -start 启动server

Linux--ssh: connect to host localhost port 22: Connection refused

今日在进行SSH免密码登陆的时候,使用SSH进行测试,抛出下面异常 ssh: connect to host localhost port 22: Connection refused 在网上收了下,答复很多,基本都是 1.没启动SSH 2.没安装SSH 3.没关防火墙 4.-. ,千篇一律. 上面的解决方案我都看了,但是还是不好使. 调研了些关于SSH的资料,内容如下, SSH:是一种安全通道协议,主要用来实现字符界面的远程登录,远程复制等功能(使用TCP的22号端口).SSH协议对通信双方的

mac connect to host localhost port 22: Connection refused

在Mac OS X 10.10.5学习hadoop的过程中,输入命令ssh localhost得到 ssh: connect to host localhost port 22: Connection refused 解决方法是选择系统偏好设置->选择共享->点击远程登录 然后再输入命令ssh localhost发现已经解决问题 找到解决方案来自于 http://stackoverflow.com/questions/6313929/how-do-i-open-port-22-in-os-x-

scp出现ssh port 22: Connection refused 问题解决具体步骤

[root(0)@sys11 09:20:29 /home/work/Code_release/bj]# scp ./release.sh  [email protected]:/Users/a2014102/Downloadsssh: connect to host 192.168.161.151 port 22: Connection refusedlost connection Solution: One possible reason is that because the ssh se

ubuntu安装配置ssh-connect to host localhost port 22: Connection refused

在安装ssh,经常出现 ssh: connect to host localhost port 22: Connection refused 从以下几点去检查: 1.是否安装ssh-server: 打开"终端窗口",输入"sudo ps -e |grep ssh"-->回车-->有sshd,说明ssh服务已经启动,如果没有启动,输入"sudo service ssh start"-->回车-->ssh服务就会启动.若无ss