samba 共享问题

2022-01-02 20:49:02 +08:00
 LxnChan

smb.conf里面设置了文件夹可访问的用户,但是本机Windows上可以匿名访问,另外一台Ubuntu主机却不能。

配置文件如下

[global]
   workgroup = WORKGROUP
   server string = ust
   log file = /home/userme/logs/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   security = user
   usershare allow guests = no

[userdisk777]
   comment = userdisk0
   path = /home/userme/userdisk0
   public = no
   read only = yes
   valid users = userme
   write list = userme
   ;invalid users = user1 user2
   create mask = 0777
   directory mask = 0777

有大神能看出来是哪里出了问题吗

1987 次点击
所在节点    Linux
6 条回复
huntagain2008
2022-01-02 21:02:58 +08:00
本人小白,可以试试 testparm smb.conf 看看实际配置是否正确。
weqopy
2022-01-02 21:03:31 +08:00
先开一下限制测试,public valid 这些,防火墙关一下,慢慢搞
我之前是 linux 配置,Windows 访问,搞了挺长时间
LxnChan
2022-01-02 21:13:24 +08:00
@huntagain2008 配置文件没问题,`testparm`是没问题的
LxnChan
2022-01-02 21:14:42 +08:00
@weqopy Emmm...现在是 Windows 里面可以匿名访问,但是按照配置文件应该是不允许匿名的
nbweb
2022-01-03 08:55:27 +08:00
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = debian
security = user
map to guest = bad user
guest account = nobody
dns proxy = no
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777

[Public]
path = /mnt/Public
browseable = yes
public = yes
available = yes
oplocks = yes
map archive = no
guest ok = yes
writable = yes

这是我 debian 里面的,参考一下。
LxnChan
2022-01-03 09:12:25 +08:00
@nbweb 好的,谢谢。我看一下

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/825831

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX