为什么我的samba始终不通啊

在本机用smbclient -L -U smb 可以登录,windows 客户机可以访问其他linux的smb,帮忙看看

[global]
#workgroup = WORKGROUP
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = No
ldap admin dn =
usershare max shares = 100
wins server =
wins support = No
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

[opt]
comment =opt/opti

inherit acls = Yes

    path = /opt
    read only = No

vfs objects =

writeable=Yes

    browseable=Yes
    create mode=0640
    directory mode=0750
    Valid users=smb  

防火墙已经关闭
linux-iz04:~ # iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
linux-iz04:~ #33-category

端口已经打开
linux-iz04:~ # ss -tln
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 50 0.0.0.0:139 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 5 127.0.0.1:631 0.0.0.0:*
LISTEN 0 100 127.0.0.1:25 0.0.0.0:*
LISTEN 0 50 0.0.0.0:445 0.0.0.0:*
LISTEN 0 50 [::]:139 [::]:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 5 [::1]:631 [::]:*
LISTEN 0 100 [::1]:25 [::]:*
LISTEN 0 50 [::]:445 [::]:*
linux-iz04:~ #

是不是没有添加用户。windows 很蠢,总是使用当前用户名(Administator)来连接 smb,如果没有这个用户就连接不上了。具体的你可以看一下 arch 的 samba 配置。

确实是windows的问题,安装网上的操作可以了https://www.jianshu.com/p/2949b398bece

删除指定共享ip地址

net use \10.10.10.10 /delete

删除所有网络连接

net use * /del /y

指定用户登录

net use \10.10.10.10 /user:用户名