![可以 ping,但不能 SSH](https://linux22.com/image/959064/%E5%8F%AF%E4%BB%A5%20ping%EF%BC%8C%E4%BD%86%E4%B8%8D%E8%83%BD%20SSH.png)
所以我有 NetworkManager,连接到 wlan1 上的 AP。我有 wlan0 连接到 AdHoc 网络。我让 Firestarter 在 Adhoc 上共享我的 inet。
我的 ipod 连接到 wlan0,IP 10.42.43.101。
wlan0 Link encap:Ethernet HWaddr ac:xx:12:81:7f:xx
inet addr:10.42.43.1 Bcast:10.255.255.255 Mask:255.0.0.0
wlan1 Link encap:Ethernet HWaddr 00:xx:b3:98:f2:xx
inet addr:10.0.1.61 Bcast:10.0.1.255 Mask:255.255.255.0
现在,我可以 ping 已越狱、启用 SSH 并正在运行的 ipod touch:
matt: ~ $ ping 10.42.43.101
PING 10.42.43.101 (10.42.43.101) 56(84) bytes of data.
64 bytes from 10.42.43.101: icmp_req=1 ttl=64 time=168 ms
64 bytes from 10.42.43.101: icmp_req=2 ttl=64 time=256 ms
64 bytes from 10.42.43.101: icmp_req=3 ttl=64 time=151 ms
^C
--- 10.42.43.101 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 151.465/191.979/256.316/46.003
但我无法通过 SSH 进行操作:
$ ssh [email protected] -vv
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.42.43.101 [10.42.43.101] port 22.
它就一直留在那里直到我 ^C 它..
这是我的路线:
$ ip route show
10.0.1.0/24 dev wlan1 proto kernel scope link src 10.0.1.61 metric 2
10.0.1.0/24 dev wlan1 proto kernel scope link src 10.0.1.61 metric 319
169.254.0.0/16 dev vboxnet0 proto kernel scope link src 169.254.128.223 metric 204
10.0.0.0/8 dev wlan0 proto kernel scope link src 10.42.43.1
default via 10.0.1.1 dev wlan1 proto static
default via 10.0.1.1 dev wlan1 metric 319
答案1
我知道您可能这样做了,但是在您尝试连接的机器上,netstat -a 是否会给您类似这样的信息:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 192.168.1.30:ssh 192.168.1.72:46480 ESTABLISHED
tcp6 0 0 [::]:ssh [::]:* LISTEN
至少其中一行应该显示类似 *:ssh 的内容,以表示要与该机器建立 ssh 连接。
如果没有,则需要启动 sshd...