免费注册 查看新帖 |

Chinaunix

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

大家帮忙看看我SHARE的模式 配置samba 怎么我测试没反应 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-02-27 22:19 |只看该作者 |倒序浏览
  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 = MYGROUP
  73.         server string = haha

  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 = share
  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. #
  126. # Domain Logons let Samba be a domain logon server for Windows workstations.
  127. #
  128. # Logon Scrpit let yuou specify a script to be run at login time on the client
  129. # You need to provide it in a share called NETLOGON
  130. #
  131. # Logon Path let you specify where user profiles are stored (UNC path)
  132. #
  133. # Various scripts can be used on a domain controller or stand-alone
  134. # machine to add or delete corresponding unix accounts
  135. #
  136. ;       security = user
  137. ;       passdb backend = tdbsam

  138. ;       domain master = yes
  139. ;       domain logons = yes

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

  147. ;       add user script = /usr/sbin/useradd "%u" -n -g users
  148. ;       add group script = /usr/sbin/groupadd "%g"
  149. ;       delete user script = /usr/sbin/userdel "%u"
  150. ;       delete user from group script = /usr/sbin/userdel "%u" "%g"
  151. ;       delete group script = /usr/sbin/groupdel "%g"


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

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

  179. ;       wins support = yes
  180. ;       wins server = w.x.y.z
  181. ;       wins proxy = yes

  182. ;       dns proxy = yes

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

  194.         load printers = yes
  195.         cups options = raw

  196. ;       printcap name = /etc/printcap
  197.         #obtain list of printers automatically on SystemV
  198. ;       printcap name = lpstat
  199. ;       printing = cups

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

  209. ;       map archive = no
  210. ;       map hidden = no
  211. ;       map read only = no
  212. ;       map system = no
  213. ;       store dos attributes = yes


  214. #============================ Share Definitions ==============================

  215. [homes]
  216.         comment = Home Directories
  217.         browseable = no
  218.         writable = yes
  219. ;       valid users = %S
  220. ;       valid users = MYDOMAIN\%S

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

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


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


  241. # A publicly accessible directory, but read only, except for people in
  242. # the "staff" group
  243. ;       [public]
  244. ;       comment = Public Stuff
  245. ;       path = /home/samba
  246. ;       public = yes
  247. ;       writable = yes
  248. ;       printable = no
  249. ;       write list = +staff
  250.         [lds]
  251.         comment = lds
  252.         path=/lds
  253.         public = yes
复制代码
  1. [root@linux1 ~]# smbclient -L 192.168.1.1
  2. Password:
  3. Anonymous login successful
  4. Domain=[WORKGROUP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

  5.         Sharename       Type      Comment
  6.         ---------       ----      -------
  7. cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine 192.168.1.1.  Error was NT_STATUS_ACCESS_DENIED
  8. Error returning browse list: NT_STATUS_ACCESS_DENIED
  9. session request to 192.168.1.1 failed (Called name not present)
  10. session request to 192 failed (Called name not present)
  11. Anonymous login successful
  12. Domain=[WORKGROUP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

  13.         Server               Comment
  14.         ---------            -------

  15.         Workgroup            Master
  16.         ---------            -------
  17. [root@linux1 ~]#
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP