无法从 Windows 访问 SAMBA 共享

Dhi*_*mar 5 linux samba

您好,这是超级用户上这个问题的重复

\n\n

由于我在那里没有得到任何答案,因此我在这里发布了这个问题,希望得到更多答案,因为这更多是针对 Linux 和 Unix 的。

\n\n

您好,我已经尝试过类似问题的解决方案,但似乎都没有解决问题。这是对问题的简短明了的描述。

\n\n

Windows 客户端操作系统:Windows Server 2008 工作组:工作组

\n\n

Linux客户端操作系统:CentOS 6.4

\n\n

目的

\n\n

从我的 Windows 客户端访问 Linux 客户端托管的 Samba 共享

\n\n

错误

\n\n

Windows无法访问\\172.16.192.99\\sambashare1

\n\n

您无权访问\\172.16.192.99\\sambashare1。请联系您的网络管理员以请求访问权限。

\n\n

我尝试过的

\n\n

这是我的 /etc/samba/smb.conf 的片段。

\n\n
#======================= Global Settings =====================================\n\n[global]\nunix charset = UTF-8\n# ----------------------- Network Related Options -------------------------\n#\n# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH\n#\n# server string is the equivalent of the NT Description field\n#\n# netbios name can be used to specify a server name not tied to the hostname\n#\n# Interfaces lets you configure Samba to use multiple interfaces\n# If you have multiple network interfaces then you can list the ones\n# you want to listen on (never omit localhost)\n#\n# Hosts Allow/Hosts Deny lets you restrict who can connect, and you can\n# specifiy it as a per share option as well\n#\n        workgroup = WORKGROUP\n        server string = Samba Server Version %v\n\n;       netbios name = MYSERVER\n\n;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24\n;       hosts allow = 127. 192.168.12. 192.168.13.\n\n# --------------------------- Logging Options -----------------------------\n.....\n.....\n\n# ----------------------- Standalone Server Options ------------------------\n#\n# Scurity can be set to user, share(deprecated) or server(deprecated)\n#\n# Backend to store user information in. New installations should\n# use either tdbsam or ldapsam. smbpasswd is available for backwards\n# compatibility. tdbsam requires no further configuration.\n\n        security = share\n        passdb backend = tdbsam\n\n# ----------------------- Domain Members Options ------------------------\n#\n...\n...\n[sambashare1]\npath = /sambashare1\nguest ok = yes\nbrowseable = yes\nwrite mode = 777\ndirectory mode = 777\nwritable = yes\nshare modes = yes\nPermissions on the directory\n\n[root@localhost sambashare1]# ls -la /\ntotal 114\n....\ndrwxrwxrwx.   2 tester root  4096 Oct 20 05:53 sambashare1\nHere\'s my /etc/smb/smbusers File\n\n# Unix_name = SMB_name1 SMB_name2 ...\nroot = administrator admin tester\nnobody = guest pcguest smbguest\n
Run Code Online (Sandbox Code Playgroud)\n\n

我可以在 Windows 上查看共享,但由于权限问题而无法访问。

\n\n

我已验证以下内容:

\n\n

SELINUX 已禁用\n两台计算机都可以互相 PING(这就是共享在 Windows 资源管理器中可见的原因)3.我还执行了以下操作

\n\n

打开运行命令并输入“secpol.msc”。

\n\n

当 Vista 提示时按“继续”。

\n\n

单击“本地策略”-->“安全选项”

\n\n

导航至策略“网络安全:LAN Manager 身份验证级别”并将其打开。

\n\n

默认情况下,Windows Vista 将策略设置为“仅 NTVLM2 响应”。将其更改为“LM 和 NTLM \xe2\x80\x93 如果协商则使用 NTLMV2 会话安全性”。

\n\n

请给我需要运行的命令。这纯粹是为了测试目的,因此我可以根据需要在 Linux 或 Windows 上创建一个新用户帐户,并根据需要修改 smb.conf 文件。

\n\n

这就是我想要的

\n\n

能够不受任何限制地访问共享。任何人都应该能够访问它。

\n\n

谢谢

\n\n

更新

\n\n

我的/etc/samba/smb.conf

\n\n
#======================= Global Settings =====================================\n[global]\nworkgroup = WORKGROUP\nsecurity = user\nmap to guest = bad password\n#============================ Share Definitions ==============================\n[MyShare]\npath = /home/samba/share\nbrowsable =yes\nwritable = yes\nguest ok = yes\nread only = no\navailable = Yes\ncreate mode = 0644\ndirectory mode = 0754\nvalid users = healy\nforce user = root\n\n[Secure]\npath = /home/samba/secure\nguest ok = yes\nwritable = yes\ncreate mask = 0664\nbrowsable = yes\navailable = Yes\ncreate mode = 0644\ndirectory mode = 0754\nvalid users = healy\nforce user = root\n
Run Code Online (Sandbox Code Playgroud)\n\n

我什至在我尝试访问的Windows 系统上创建了用户healyroot 。Windows 上的这些用户与 Linux 上的用户具有相同的密码。

\n\n

我可以查看目录结构,但无法创建文件或查看任何文件

\n

小智 4

您是否为服务器上的用户添加了 samba 密码?

对于您希望能够访问 samba 共享的每个用户帐户,请在服务器上执行以下操作:

smbpasswd -a username
Run Code Online (Sandbox Code Playgroud)

然后它会要求输入 samba 密码。我通常将其设置为与用户的系统帐户密码相同。