我是
linux防火墙的新手
root@Ubntu:~# ufw status verbose state: active logging: on (low) Default: deny (incoming),allow (outgoing),disabled (routed) new profiles: skip 137,138/udp (Samba) ALLOW IN Anywhere 139,445/tcp (Samba) ALLOW IN Anywhere 22 ALLOW IN Anywhere 80 ALLOW IN Anywhere 137,138/udp (Samba (v6)) ALLOW IN Anywhere (v6) 139,445/tcp (Samba (v6)) ALLOW IN Anywhere (v6) 22 (v6) ALLOW IN Anywhere (v6) 80 (v6) ALLOW IN Anywhere (v6)
ufw允许samba(或http) – 什么都不做,端口保持关闭状态
ufw允许ssh – 打开ssh端口
ufw disable – 只打开ssh端口
根据netstat samba服务器正在监听:
tcp 0 0 127.0.0.1:139 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:445 0.0.0.0:* LISTEN
我假设其他一些防火墙规则禁止访问.
请帮助解决问题
PS试图清除iptables防火墙规则,没有运气:
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
问题是您的samba服务器只侦听localhost接口.您需要在smb.conf中包含以下内容:
原文链接:https://www.f2er.com/ubuntu/347685.html[global] interfaces = eth0 bind interfaces only = yes
这样Samba将监听eth0接口,以便接受来自网络的连接.