没有使用 ssh 到主机的路由

没有使用 ssh 到主机的路由

我在使用 ssh 进行远程服务器连接时遇到问题。我在 xxx.xxx.xxx.xx1 上有一个服务器 A,默认端口为 22。我在 xxx.xxx.xxx.xx2 上有另一个服务器 B,默认端口为 22。现在我想使用 ssh 从 serverA 连接 serverB。我使用了以下命令

[userA@localhost~] # ssh userB@serverB

当我运行此命令时,出现如下错误

ssh: connect to host xxx.xxx.xxx.xx1 port 22: No route to host

当我登录 serverA 时,又会看到这样的提示 [用户A@本地主机~]#

我不明白为什么它显示为上面的粗体文本,而它应该显示为 [userA@serverA ~] # 任何人都有解决此问题的想法。

更新

我已经 ping 但收到以下响应

[userA@localhost ~]# /bin/ping xxx.xxx.xxx.xx1
PING xxx.xxx.xxx.xx1 (xxx.xxx.xxx.xx1) 56(84) bytes of data.
From 192.168.24.1: icmp_seq=2 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1: icmp_seq=3 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1: icmp_seq=4 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1 icmp_seq=2 Destination Host Unreachable
From 192.168.24.1 icmp_seq=3 Destination Host Unreachable
From 192.168.24.1 icmp_seq=4 Destination Host Unreachable
From 192.168.24.1: icmp_seq=5 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1: icmp_seq=6 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1: icmp_seq=8 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1 icmp_seq=6 Destination Host Unreachable
From 192.168.24.1 icmp_seq=7 Destination Host Unreachable
From 192.168.24.1 icmp_seq=8 Destination Host Unreachable
From 192.168.24.1: icmp_seq=11 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1 icmp_seq=10 Destination Host Unreachable
From 192.168.24.1 icmp_seq=11 Destination Host Unreachable
From 192.168.24.1 icmp_seq=12 Destination Host Unreachable
From 192.168.24.1 icmp_seq=13 Destination Host Unreachable
From 192.168.24.1 icmp_seq=14 Destination Host Unreachable
From 192.168.24.1 icmp_seq=15 Destination Host Unreachable
From 192.168.24.1: icmp_seq=17 Redirect Host(New nexthop: xxx.xxx.xxx.xx1)
From 192.168.24.1 icmp_seq=17 Destination Host Unreachable
From 192.168.24.1 icmp_seq=18 Destination Host Unreachable

更新-2

我运行 netstat 命令并得到结果为

[userA@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.24.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.24.1    0.0.0.0         UG        0 0          0 eth0

相关内容