
我可以正常 ping 和 ssh 到伺服器。但將其移至新 mac 後無法在 chrome 或 firefox 中開啟它。我的設定是 Mountain Lion 上的 vmware Fusion,運行 ubuntu 伺服器。 Mac 上的主機檔案:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
192.168.222.128 local.server.com
Ping 運作正常,但 telnet 失敗:
$ telnet local.server.com
Trying 192.168.222.128...
telnet: connect to address 192.168.222.128: Connection refused
vmware 映像設定為使用 NAT。如果我切換到橋接,則沒有任何效果,甚至 ping 或 ssh 也不起作用。
圖中的 ipctables 如下圖所示:
sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
任何想法都非常感激。到處尋找解決辦法都沒有成功。
答案1
確保安裝了 Apache 或 nginx 等網頁伺服器,並在 192.168.222.128 上執行和偵聽。
答案2
Umbutu 和許多其他 Linux 發行版預設不會安裝 telnet 守護進程,因此強烈建議不要使用 telnet。請改用安全外殼。如果未安裝 ssh,可以透過sudo apt-get install ssh-server
在 umbutu 上運行來安裝。