"ssh connection refused" error sometimes.
来源:互联网 发布:软件windowsphone 编辑:程序博客网 时间:2024/05/16 21:11
Issues:
Got "ssh connection refused" error sometimes. Tried below:
1. Ping the IP(10.19.224.105) and could ping without problem.
2. Using ssh root@10.19.224.105 to ssh the host, got the "ssh connection refused" error, but sometimes i could ssh to login without problem.
How to resolve:
1. Use "arping" to check if the there is the IP conflict issues, and the same IP was assigned to the different MAC address. After checking, there were two MAC responded the ping.
test@test-ubuntu10:~$ sudo arping 10.19.224.105
ARPING 10.19.224.105 from 10.19.224.129 eth0
Unicast reply from 10.19.224.105 [00:50:C2:70:49:4F] 1.045ms
Unicast reply from 10.19.224.105 [E0:3F:49:80:7C:7E] 1.166ms
Unicast reply from 10.19.224.105 [E0:3F:49:80:7C:7E] 1.145ms
^CSent 2 probes (1 broadcast(s))
host@host-ubuntu:~$ ifconfig
eth0 Link encap:Ethernet HWaddr e0:3f:49:80:7c:7e
inet addr:10.19.224.15 Bcast:10.19.224.255 Mask:255.255.255.0
inet6 addr: fe80::e23f:49ff:fe80:7c7e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5628 errors:0 dropped:0 overruns:0 frame:0
TX packets:1734 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:599545 (599.5 KB) TX bytes:177451 (177.4 KB)
Interrupt:45
2. To confirm above conclusion, shutdown the host machine, and check if 10.19.224.105 could be pinged successfully. If yes, then the IP conflict issue was confirmed, and we could assigned the IP to another one. Then issue could be resolved.
Referred net webs:
http://askubuntu.com/questions/30080/how-to-solve-connection-refused-errors-in-ssh-connection
Some tips:
===========================================================================
Tips One:
Use arping
on the IP address that is having connection issues. That will show the MAC address for each ping reply, and hopefully will unmask the rogue MAC address.
arping 192.168.2.254
You should check the DHCP IP address pool on the DHCP server, make sure no devices have static IPs that collide with the DHCP pool.
These clues point to duplicate IP:
- ping ttl and round trip time looks like 2 distinct servers
- intermittent disconnects without rebooting
Tips Two:
What do you get if you do this :-
cat /etc/hosts.deny | grep 192.168.2.25
If that returns anything then you need to remove it.
Tips Three:
IP address conflict turned out to be the root cause when I was seeing this SSH error message.
After reading the answers above I suspected an IP address conflict, but needed to prove that address conflict was or was not the problem.
This great article showed how to use arp-scan to see if two pieces of hardware were claiming the same IP address.
In my case the server machine had a static ip address of 192.168.1.42, I used arp-scan to check that address:
$ sudo apt-get install arp-scan$ arp-scan -I eth0 -l | grep 192.168.1.42 192.168.1.42 d4:eb:9a:f2:11:a1 (Unknown) 192.168.1.42 f4:23:a4:38:b5:76 (Unknown) (DUP: 2)
Sure enough there was a conflict, as shown above. Then I ran arp-scan without the grep, found that .43 was available, went and edited /etc/network/interfaces
and changed the static ip from .42 to .43
===========================================================================
- "ssh connection refused" error sometimes.
- ssh:Network error:connection refused的排查
- scp ssh Connection refused
- SSH connection refused 配置
- SSH Connection refused
- ssh connection refused 解决办法
- ssh连接树莓派出现"network error:connection refused"的解决办法
- ssh连接树莓派出现"network error:connection refused"的解决办法
- error connection refused
- Mac ssh locahost Connection refused
- 错误处理 ssh connection refused
- putty:network error:Connection refused
- error: [Errno 111] Connection refused
- SSH connection refused的问题解决方法
- cygwin ssh: localhost port 22: Connection refused
- ssh登陆connection refused的解决办法
- Ubuntu ssh port 22 :Connection refused
- 解决虚拟机ssh连接出错connection refused
- BTE的理解和开发
- 设计模式--观察者模式
- C++随机函数用法详解
- 内存管理之malloc、free、calloc和realloc
- Linux内核构建系统之七
- "ssh connection refused" error sometimes.
- Andorid 4.4 AMS(一 数据结构)
- Ethernet keepalive 信息
- Linux内核构建系统之八
- 四个“混搭”式理财方案最简单
- easyui datagrid url mvc 参数动态
- maven自动生成常用框架工程命令-只显示前50个archetype
- 如何减小与“大牛”的差距
- Linux内核构建系统之九