免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 29665 | 回复: 3
打印 上一主题 下一主题

[网络配置] Win7连接samba后无法打开共享文件夹【Windows服务没问题的,已经连接上了的】 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-05 13:03 |只看该作者 |倒序浏览






一开始连接也出问题的,解决了。
参考过以下文章:
解决windows7客户端无法访问Samba服务器的故障 - 通信,我的最爱 - 51CTO技术博客
http://dgd2010.blog.51cto.com/1539422/835765

但现在为什么不能打开共享文件夹的呢?如图所示。


smb.conf文件内容如下:
  1. # This is the main Samba configuration file. You should read the
  2. # smb.conf(5) manual page in order to understand the options listed
  3. # here. Samba has a huge number of configurable options (perhaps too
  4. # many!) most of which are not shown in this example
  5. #
  6. # For a step to step guide on installing, configuring and using samba,
  7. # read the Samba-HOWTO-Collection. This may be obtained from:
  8. #  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
  9. #
  10. # Many working examples of smb.conf files can be found in the
  11. # Samba-Guide which is generated daily and can be downloaded from:
  12. #  http://www.samba.org/samba/docs/Samba-Guide.pdf
  13. #
  14. # Any line which starts with a ; (semi-colon) or a # (hash)
  15. # is a comment and is ignored. In this example we will use a #
  16. # for commentry and a ; for parts of the config file that you
  17. # may wish to enable
  18. #
  19. # NOTE: Whenever you modify this file you should run the command "testparm"
  20. # to check that you have not made any basic syntactic errors.
  21. #
  22. #---------------
  23. # SELINUX NOTES:
  24. #
  25. # If you want to use the useradd/groupadd family of binaries please run:
  26. # setsebool -P samba_domain_controller on
  27. #
  28. # If you want to share home directories via samba please run:
  29. # setsebool -P samba_enable_home_dirs on
  30. #
  31. # If you create a new directory you want to share you should mark it as
  32. # "samba-share_t" so that selinux will let you write into it.
  33. # Make sure not to do that on system directories as they may already have
  34. # been marked with othe SELinux labels.
  35. #
  36. # Use ls -ldZ /path to see which context a directory has
  37. #
  38. # Set labels only on directories you created!
  39. # To set a label use the following: chcon -t samba_share_t /path
  40. #
  41. # If you need to share a system created directory you can use one of the
  42. # following (read-only/read-write):
  43. # setsebool -P samba_export_all_ro on
  44. # or
  45. # setsebool -P samba_export_all_rw on
  46. #
  47. # If you want to run scripts (preexec/root prexec/print command/...) please
  48. # put them into the /var/lib/samba/scripts directory so that smbd will be
  49. # allowed to run them.
  50. # Make sure you COPY them and not MOVE them so that the right SELinux context
  51. # is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts
  52. #
  53. #--------------
  54. #
  55. #======================= Global Settings =====================================

  56. [global]

  57. # ----------------------- Network Related Options -------------------------
  58. #
  59. # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
  60. #
  61. # server string is the equivalent of the NT Description field
  62. #
  63. # netbios name can be used to specify a server name not tied to the hostname
  64. #
  65. # Interfaces lets you configure Samba to use multiple interfaces
  66. # If you have multiple network interfaces then you can list the ones
  67. # you want to listen on (never omit localhost)
  68. #
  69. # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
  70. # specifiy it as a per share option as well
  71. #
  72.         workgroup = workgroup
  73.         server string = Samba Server Version %v

  74. ;        netbios name = MYSERVER

  75. ;        interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
  76. ;        hosts allow = 127. 192.168.12. 192.168.13.

  77. # --------------------------- Logging Options -----------------------------
  78. #
  79. # Log File let you specify where to put logs and how to split them up.
  80. #
  81. # Max Log Size let you specify the max size log files should reach

  82.         # logs split per machine
  83. ;        log file = /var/log/samba/%m.log
  84.         # max 50KB per log file, then rotate
  85. ;        max log size = 50

  86. # ----------------------- Standalone Server Options ------------------------
  87. #
  88. # Security can be set to user, share(deprecated) or server(deprecated)
  89. #
  90. # Backend to store user information in. New installations should
  91. # use either tdbsam or ldapsam. smbpasswd is available for backwards
  92. # compatibility. tdbsam requires no further configuration.

  93.         security = user
  94.         passdb backend = tdbsam


  95. # ----------------------- Domain Members Options ------------------------
  96. #
  97. # Security must be set to domain or ads
  98. #
  99. # Use the realm option only with security = ads
  100. # Specifies the Active Directory realm the host is part of
  101. #
  102. # Backend to store user information in. New installations should
  103. # use either tdbsam or ldapsam. smbpasswd is available for backwards
  104. # compatibility. tdbsam requires no further configuration.
  105. #
  106. # Use password server option only with security = server or if you can't
  107. # use the DNS to locate Domain Controllers
  108. # The argument list may include:
  109. #   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
  110. # or to auto-locate the domain controller/s
  111. #   password server = *


  112. ;        security = domain
  113. ;        passdb backend = tdbsam
  114. ;        realm = MY_REALM

  115. ;        password server = <NT-Server-Name>

  116. # ----------------------- Domain Controller Options ------------------------
  117. #
  118. # Security must be set to user for domain controllers
  119. #
  120. # Backend to store user information in. New installations should
  121. # use either tdbsam or ldapsam. smbpasswd is available for backwards
  122. # compatibility. tdbsam requires no further configuration.
  123. #
  124. # Domain Master specifies Samba to be the Domain Master Browser. This
  125. # allows Samba to collate browse lists between subnets. Don't use this
  126. # if you already have a Windows NT domain controller doing this job
  127. #
  128. # Domain Logons let Samba be a domain logon server for Windows workstations.
  129. #
  130. # Logon Scrpit let yuou specify a script to be run at login time on the client
  131. # You need to provide it in a share called NETLOGON
  132. #
  133. # Logon Path let you specify where user profiles are stored (UNC path)
  134. #
  135. # Various scripts can be used on a domain controller or stand-alone
  136. # machine to add or delete corresponding unix accounts
  137. #
  138. ;        security = user
  139. ;        passdb backend = tdbsam

  140. ;        domain master = yes
  141. ;        domain logons = yes

  142.         # the login script name depends on the machine name
  143. ;        logon script = %m.bat
  144.         # the login script name depends on the unix user used
  145. ;        logon script = %u.bat
  146. ;        logon path = \\%L\Profiles\%u
  147.         # disables profiles support by specifing an empty path
  148. ;        logon path =  

  149. ;        add user script = /usr/sbin/useradd "%u" -n -g users
  150. ;        add group script = /usr/sbin/groupadd "%g"
  151. ;        add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
  152. ;        delete user script = /usr/sbin/userdel "%u"
  153. ;        delete user from group script = /usr/sbin/userdel "%u" "%g"
  154. ;        delete group script = /usr/sbin/groupdel "%g"


  155. # ----------------------- Browser Control Options ----------------------------
  156. #
  157. # set local master to no if you don't want Samba to become a master
  158. # browser on your network. Otherwise the normal election rules apply
  159. #
  160. # OS Level determines the precedence of this server in master browser
  161. # elections. The default value should be reasonable
  162. #
  163. # Preferred Master causes Samba to force a local browser election on startup
  164. # and gives it a slightly higher chance of winning the election
  165. ;        local master = no
  166. ;        os level = 33
  167. ;        preferred master = yes

  168. #----------------------------- Name Resolution -------------------------------
  169. # Windows Internet Name Serving Support Section:
  170. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  171. #
  172. # - WINS Support: Tells the NMBD component of Samba to enable it's WINS Server
  173. #
  174. # - WINS Server: Tells the NMBD components of Samba to be a WINS Client
  175. #
  176. # - WINS Proxy: Tells Samba to answer name resolution queries on
  177. #   behalf of a non WINS capable client, for this to work there must be
  178. #   at least one        WINS Server on the network. The default is NO.
  179. #
  180. # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
  181. # via DNS nslookups.

  182. ;        wins support = yes
  183. ;        wins server = w.x.y.z
  184. ;        wins proxy = yes

  185. ;        dns proxy = yes

  186. # --------------------------- Printing Options -----------------------------
  187. #
  188. # Load Printers let you load automatically the list of printers rather
  189. # than setting them up individually
  190. #
  191. # Cups Options let you pass the cups libs custom options, setting it to raw
  192. # for example will let you use drivers on your Windows clients
  193. #
  194. # Printcap Name let you specify an alternative printcap file
  195. #
  196. # You can choose a non default printing system using the Printing option

  197.         load printers = yes
  198.         cups options = raw

  199. ;        printcap name = /etc/printcap
  200.         #obtain list of printers automatically on SystemV
  201. ;        printcap name = lpstat
  202. ;        printing = cups

  203. # --------------------------- Filesystem Options ---------------------------
  204. #
  205. # The following options can be uncommented if the filesystem supports
  206. # Extended Attributes and they are enabled (usually by the mount option
  207. # user_xattr). Thess options will let the admin store the DOS attributes
  208. # in an EA and make samba not mess with the permission bits.
  209. #
  210. # Note: these options can also be set just per share, setting them in global
  211. # makes them the default for all shares

  212. ;        map archive = no
  213. ;        map hidden = no
  214. ;        map read only = no
  215. ;        map system = no
  216. ;        store dos attributes = yes


  217. #============================ Share Definitions ==============================

  218. [homes]
  219.         comment = Home Directories
  220.         browseable = no
  221.         writable = yes
  222. ;        valid users = %S
  223. ;        valid users = MYDOMAIN\%S

  224. [printers]
  225.         comment = All Printers
  226.         path = /var/spool/samba
  227.         browseable = no
  228.         guest ok = no
  229.         writable = no
  230.         printable = yes

  231. # Un-comment the following and create the netlogon directory for Domain Logons
  232. ;        [netlogon]
  233. ;        comment = Network Logon Service
  234. ;        path = /var/lib/samba/netlogon
  235. ;        guest ok = yes
  236. ;        writable = no
  237. ;        share modes = no


  238. # Un-comment the following to provide a specific roving profile share
  239. # the default is to use the user's home directory
  240. ;        [Profiles]
  241. ;        path = /var/lib/samba/profiles
  242. ;        browseable = no
  243. ;        guest ok = yes


  244. # A publicly accessible directory, but read only, except for people in
  245. # the "staff" group
  246. ;        [public]
  247. ;        comment = Public Stuff
  248. ;        path = /home/samba
  249. ;        public = yes
  250. ;        writable = yes
  251. ;        printable = no
  252. ;        write list = +staff
复制代码

论坛徽章:
0
2 [报告]
发表于 2012-10-05 14:33 |只看该作者
在xp中是正常打开的。。。

论坛徽章:
0
3 [报告]
发表于 2012-10-05 19:21 |只看该作者
1、先看下windows的工作组是不是workgroup
2、考虑下你的防火墙有没有开放samba,我之前也是,纠结了半天,原来是linux防火墙没放行,window的防火墙也关注下。建议两边的防火墙先关掉测试,如果ok,在开启防火墙做细致的iptable。
3、SElinux的设置也要看下,最好现在linux试着挂载自己的samba,看是否会出现问题。

呵呵,我也是刚学,刚架了个samba,也是纠结了老半天。

论坛徽章:
0
4 [报告]
发表于 2013-10-16 23:03 |只看该作者
我也遇到这个问题了,答案在这里啊
http://www.yesure.net/archives/6877.html
摘要:
默认情况下,Windows 7无法正常访问NAS或者Samba服务器上的共享文件夹。原因在于从Vista开始,微软默认只采用NTLM v2协议的认证回应消息了,而目前的NAS系统和Samba还只支持LM或者NTLM。
解决办法:修改本地安全策略或直接修改注册表
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP