Linux

無法訪問 samba 伺服器

  • May 16, 2014

我無法連接到不在我的網路中執行 CentOS 6.4(最小安裝)的 samba 伺服器。

當我嘗試連接我的 Windows 7 客戶端時,連接失敗並顯示預設的“無法訪問”對話框。

到目前為止我已經嘗試過:

  • 在我的 samba 伺服器上打開埠 137、138、139、445
  • 使用 nmap 驗證埠是否打開(在 samba 伺服器上)
  • 嘗試從我的客戶端遠端登錄上述埠,但連接也失敗
  • 重新安裝 samba 並重新配置服務
  • 暫時關閉 SELinux

iptables

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:netbios-ns
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:netbios-dgm
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:netbios-ssn
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:microsoft-ds
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

地圖

#nmap -sTU -O localhost

Starting Nmap 5.51 ( http://nmap.org ) at 2014-05-16 17:29 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000042s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 1994 closed ports
PORT    STATE         SERVICE
22/tcp  open          ssh
25/tcp  open          smtp
80/tcp  open          http
139/tcp open          netbios-ssn
445/tcp open          microsoft-ds
68/udp  open|filtered dhcpc

桑巴版

#smbd --version
Version 3.6.9-168.el6_5

在 smb.conf 中正確設置了工作組,nmb 正在執行。

大多數 ISP 過濾 netbios 埠。如果您從 Windows 客戶端進行 nmap,您可能會看到該埠被列為filtered因為您的 ISP 阻止了它。

嘗試配置隧道協議,例如openvpn並嘗試使用此設置。

引用自:https://serverfault.com/questions/596572