LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 691|回复: 0

samba配置问题

[复制链接]
发表于 2006-4-26 22:39:48 | 显示全部楼层 |阅读模式
原来一直是security = share很好用,现在需要用用户名和密码访问共享目录.
我改成security = user,然后用smbpasswd -a xxx添加了用户名.但是还是不行.

附上我的/etc/samba/smb.conf
  1. #
  2. # Sample configuration file for the Samba suite for Debian GNU/Linux.
  3. #
  4. #
  5. # This is the main Samba configuration file. You should read the
  6. # smb.conf(5) manual page in order to understand the options listed
  7. # here. Samba has a huge number of configurable options most of which
  8. # are not shown in this example
  9. #
  10. # Any line which starts with a ; (semi-colon) or a # (hash)
  11. # is a comment and is ignored. In this example we will use a #
  12. # for commentary and a ; for parts of the config file that you
  13. # may wish to enable
  14. #
  15. # NOTE: Whenever you modify this file you should run the command
  16. # "testparm" to check that you have not many any basic syntactic
  17. # errors.
  18. #

  19. #======================= Global Settings =======================

  20. [global]
  21. ## Browsing/Identification ###

  22. # Change this to the workgroup/NT-domain name your Samba server will part of
  23.    workgroup = workgroup

  24. # server string is the equivalent of the NT Description field
  25.    server string = %h server (Samba %v)

  26. # Windows Internet Name Serving Support Section:
  27. # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  28. ;   wins support = no

  29. # WINS Server - Tells the NMBD components of Samba to be a WINS Client
  30. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  31. ;   wins server = w.x.y.z

  32. # This will prevent nmbd to search for NetBIOS names through DNS.
  33.    dns proxy = no

  34. # What naming service and in what order should we use to resolve host names
  35. # to IP addresses
  36. ;   name resolve order = lmhosts host wins bcast


  37. #### Debugging/Accounting ####

  38. # This tells Samba to use a separate log file for each machine
  39. # that connects
  40.    log file = /var/log/samba/log.%m

  41. # Put a capping on the size of the log files (in Kb).
  42.    max log size = 1000

  43. # If you want Samba to only log through syslog then set the following
  44. # parameter to 'yes'.
  45. ;   syslog only = no

  46. # We want Samba to log a minimum amount of information to syslog. Everything
  47. # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
  48. # through syslog you should set the following parameter to something higher.
  49.    syslog = 0

  50. # Do something sensible when Samba crashes: mail the admin a backtrace
  51.    panic action = /usr/share/samba/panic-action %d


  52. ####### Authentication #######

  53. # "security = user" is always a good idea. This will require a Unix account
  54. # in this server for every user accessing the server. See
  55. # /usr/share/doc/samba-doc/htmldocs/ServerType.html in the samba-doc
  56. # package for details.
  57.    security = user

  58. # You may wish to use password encryption.  See the section on
  59. # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
  60.    encrypt passwords = true

  61. # If you are using encrypted passwords, Samba will need to know what
  62. # password database type you are using.  
  63.    passdb backend = tdbsam guest

  64.    obey pam restrictions = yes

  65. ;   guest account = nobody
  66.    invalid users = root

  67. # This boolean parameter controls whether Samba attempts to sync the Unix
  68. # password with the SMB password when the encrypted SMB password in the
  69. # passdb is changed.
  70. ;   unix password sync = no

  71. # For Unix password sync to work on a Debian GNU/Linux system, the following
  72. # parameters must be set (thanks to Augustin Luton <aluton@hybrigenics.fr> for
  73. # sending the correct chat script for the passwd program in Debian Potato).
  74.    passwd program = /usr/bin/passwd %u
  75.    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

  76. # This boolean controls whether PAM will be used for password changes
  77. # when requested by an SMB client instead of the program listed in
  78. # 'passwd program'. The default is 'no'.
  79. ;   pam password change = no


  80. ########## Printing ##########

  81. # If you want to automatically load your printer list rather
  82. # than setting them up individually then you'll need this
  83. ;   load printers = yes

  84. # lpr(ng) printing. You may wish to override the location of the
  85. # printcap file
  86. ;   printing = bsd
  87. ;   printcap name = /etc/printcap

  88. # CUPS printing.  See also the cupsaddsmb(8) manpage in the
  89. # cupsys-client package.
  90. ;   printing = cups
  91. ;   printcap name = cups

  92. # When using [print$], root is implicitly a 'printer admin', but you can
  93. # also give this right to other users to add drivers and set printer
  94. # properties
  95. ;   printer admin = @ntadmin


  96. ######## File sharing ########

  97. # Name mangling options
  98. ;   preserve case = yes
  99. ;   short preserve case = yes


  100. ############ Misc ############

  101. # Using the following line enables you to customise your configuration
  102. # on a per machine basis. The %m gets replaced with the netbios name
  103. # of the machine that is connecting
  104. ;   include = /home/samba/etc/smb.conf.%m

  105. # Most people will find that this option gives better performance.
  106. # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
  107. # for details
  108. # You may want to add the following on a Linux system:
  109. #         SO_RCVBUF=8192 SO_SNDBUF=8192
  110.    socket options = TCP_NODELAY

  111. # The following parameter is useful only if you have the linpopup package
  112. # installed. The samba maintainer and the linpopup maintainer are
  113. # working to ease installation and configuration of linpopup and samba.
  114. ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

  115. # Domain Master specifies Samba to be the Domain Master Browser. If this
  116. # machine will be configured as a BDC (a secondary logon server), you
  117. # must set this to 'no'; otherwise, the default behavior is recommended.
  118. ;   domain master = auto

  119. # Some defaults for winbind (make sure you're not using the ranges
  120. # for something else.)
  121. ;   idmap uid = 10000-20000
  122. ;   idmap gid = 10000-20000
  123. ;   template shell = /bin/bash

  124. #======================= Share Definitions =======================

  125. [homes]
  126.    comment = Home Directories
  127.    browseable = yes

  128. # By default, the home directories are exported read-only. Change next
  129. # parameter to 'yes' if you want to be able to write to them.
  130.    writable = no

  131. # File creation mask is set to 0700 for security reasons. If you want to
  132. # create files with group=rw permissions, set next parameter to 0775.
  133.    create mask = 0700

  134. # Directory creation mask is set to 0700 for security reasons. If you want to
  135. # create dirs. with group=rw permissions, set next parameter to 0775.
  136.    directory mask = 0700

  137. # Un-comment the following and create the netlogon directory for Domain Logons
  138. # (you need to configure Samba to act as a domain controller too.)
  139. ;[netlogon]
  140. ;   comment = Network Logon Service
  141. ;   path = /home/samba/netlogon
  142. ;   guest ok = yes
  143. ;   writable = no
  144. ;   share modes = no

  145. [printers]
  146.    comment = All Printers
  147.    browseable = no
  148.    path = /tmp
  149.    printable = yes
  150.    public = no
  151.    writable = no
  152.    create mode = 0700

  153. # Windows clients look for this share name as a source of downloadable
  154. # printer drivers
  155. [print$]
  156.    comment = Printer Drivers
  157.    path = /var/lib/samba/printers
  158.    browseable = yes
  159.    read only = yes
  160.    guest ok = no
  161. # Uncomment to allow remote administration of Windows print drivers.
  162. # Replace 'ntadmin' with the name of the group your admin users are
  163. # members of.
  164. ;   write list = root, @ntadmin

  165. # A sample share for sharing your CD-ROM with others.
  166. ;[cdrom]
  167. ;   comment = Samba server's CD-ROM
  168. ;   writable = no
  169. ;   locking = no
  170. ;   path = /cdrom
  171. ;   public = yes

  172. # The next two parameters show how to auto-mount a CD-ROM when the
  173. #        cdrom share is accesed. For this to work /etc/fstab must contain
  174. #        an entry like this:
  175. #
  176. #       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
  177. #
  178. # The CD-ROM gets unmounted automatically after the connection to the
  179. #
  180. # If you don't want to use auto-mounting/unmounting make sure the CD
  181. #        is mounted on /cdrom
  182. #
  183. ;   preexec = /bin/mount /cdrom
  184. ;   postexec = /bin/umount /cdrom
  185. [linuxsir]
  186.         path = /home/huyongzs
  187.         writeable = yes
  188.         browseable = yes
  189.         guest ok = yes
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表