我正在尝试在 Centos 机器上设置 Samba 共享。我想使用 OS X 上的 smbclient 连接到此服务器。以下是发生的情况:
> smbclient -L X.X.X.X
timeout connecting to X.X.X.X:445
timeout connecting to X.X.X.X:139
Error connecting to X.X.X.X (Operation already in progress)
Connection to X.X.X.X failed
可能出了什么问题?这是我在 Centos 机器(服务器)上的 iptables 转储:
> iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 0.0.0.0/0 127.0.0.0/8 reject-with icmp-port-unreachable
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:445
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3000
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 8
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3000
最后,我的 smb.conf:
[global]
workgroup = workgroup
security = SHARE
load printers = No
default service = global
path = /home
available = No
encrypt passwords = yes
[share]
writeable = yes
admin users = myusername
path = /home/myhome/
force user = root
valid users = myusername
public = yes
available = yes
答案1
您可以尝试刷新 iptable 规则来测试它是否在没有规则的情况下有效:
iptables -F
这可能会缩小您的搜索范围,甚至可能解决您的问题。