Let's take a look at my smb.conf file: # Note: WHENEVER You modify this file you shouth "TestParm" # to check That You have not masteri Basic syntactic errors. # /Etc/samba/smb.conf file # # ====================================================================================================================================== ============== [Global] Workgroup = Linux create mask = 0755 Directory Mask = 0755 # Because Samba is written in Europe, the default value of Client Code Page is 850 (Western Europe ). # We need to change it to 936 (Chinese Simplified). {437 (USA)} Client Code Page = 936 DOS Charset = CP936 UNIX Charset = CP936 # guest User Mapping Only for Security Mode (User, Server, and Domain Security). # If a user does not pass authentication, it can map it to guest users. This allows # 他 他 g 共. Here guest users are specified by guest account = parameters.
Map to guest = bad user map to guest = bad password guest account = number # ------- Winpopup chat with Windows machine ------- # # In order to handle WinPopup information, Samba provides " Message Command "Global Parameters, it defines the measures that Samba should take when the information arrives. For example:;; message command = / bin / mail -s 'message from% f on% m' root <% s; RM% S & ;: This command must return immediately, so there should be symbol "&".; Message Command = / usr / x11r6 / bin / gvim% s; RM -F% S & == no success ==; Message Command = / usr / bin / gxedit% s; rm -f% s & == no success ==; message command = / usr / bin / kWrite% S; RM -F% S &; Message Command = / usr / bin / gless% s; rm -f% s & == no success ==; message command = / usr / bin / gNp% S; RM -F% s & == no success ==; message command = / usr / bin / KEDIT% S; RM -F% S &; Message command = / usr / bin / gedit% s; RM -F% s & == no second ==; message command = (/ usr / bin / gless% s; RM-F% S) &; Message Command = / usr / bin / gless% S; RM -F% S &; Message Command = / bin / mail -s 'message from% f% m on% m% i' root <% S; RM -F% S &; Message Command = / usr / bin / linpopup "% f" "% M "% s; rm% s message command = / usr / bin / linpopup"% f ""% m "% s; rm% s # # w w w w: Name resolve order = host wins bcast lmhosts local master = YES # ------------------ Working in the domain ------------------ Domain master = yes preferred master = yes Domain logons = yes # ------------------ Working in the domain login ------------------ # If you log in Service, for each machine or each user, you may need a login script to run the specified batch file. # For a "machine" run login batch processing file. Logon script =% m.bat # For a "user" running login batch file.
Logon script =% u.bat announce version = 5.0 Announce as = Windows NT Enterprise Edition 5.0 log file = /VAR/LOG/SAMBA/LOG.%M max log size = 0; Interfaces = 192.168.20.8/24 211.148.130.133 / 28 deadTime = 5 hosts allow = 127.0.0. 192.168.20. 192.168.30. 211.148.255.240 Hosts deny = all # As long as the user has permission, even if the directory is not empty, it can be deleted. DELETE VETO Files = True # Make "Nimba WORM" virus written files that are not visible to all clients (* .eml, *. nws, riched20.dll). Veto files = /*.eml/.nws/rice20.dll/*.bat/.scr/*.pif/ # also makes the file written by the "Klez Worm" virus. All clients are not visible. # (Note: *. Bat, *. SCR, *. PIF, *. RAR and other files are not completely virus written!) # Display the contents of directory "/ proc" and "/ dev" empty. DONT DESCEND = / proc, / dev # Sets time parsing to 2 seconds, to make Visual C better (when acting on shared SMB files). DOS filetime resolution = true # Specifies the run command when the customer is connected to a service. Preexec = csh -c echo / "welcome to% s! /" | smbclient -m% m -i% I & printcap name = / etc / printcap load printers = YES printing = lprng max log size = 0 security = user # ================ To make Samba use encryption password, the following parameters must be added: ========================= Encrypt Passwords = YES SMB Passwd file = / etc / samba / smbpasswd # ====== If the user is allowed to use a space password, the following parameters should be used:; null passwords = yes unix password sync = yes passwd program = / usr / bin / passwd% u passwd chat = * New * password *% n / n * Retype * new * password *% n / n * passwd: * all * authentication * tokens * updated * successfully *; obey pam restrictions = yes socket options = TCP_NODELAY SO_RCVBUF = 8192 SO_SNDBUF = 8192 # Make this machine a WINS server.
WINS Support = YES; WINS Proxy = YES DNS Proxy = no # ================================================================================================================================================== ================================= # If you want Uses Samba Doesn't Recognize To Be mapped to a guest user; map to guest = bad user [public file] comment = public folder # This directory is not required to be system or Samba users can read . # 其 属 主 主 为 or other users (not Nobody, safe reasons). # Its directory property is 755 or more, the file properties are 644 or more. Path = / home / gugong / public # In fact, this directory is gugong to manage. Browseable = yes Writable = no read online mask = 0666 [Temporary folder] comment = You can copy your file to this directory # This directory is not required to be a system or Samba users can write of. # Its directory properties should be: 1777.
Path = / home / tmp broseable = yes Writable = yes read online mask = 0666; [dynamic web]; comment = apache php4 mysql dynamic web page; Path = / var / www / phtml; read only = yes; public = yes [netlogon] comment = Network Logon Service path = / home / netlogon guest ok = yes writable = no share modes = no # Un-comment the following and create the netlogon directory for Domain Logons; [netlogon] Comment = network logon service; path = / usr / local / samba / lib / Netlogon; guest ok = yes; Writable = NO; Share Modes = NO; [CD-ROM]; Comment = WWW CD-ROM; PATH = / mNT / CDROM; Guest ok = yes; browseable = yes [profiles] Path = / home /% u / profiles # put the user's private Profiles directory in the home directory of the user. ; Browseable = no guest ok = yes # Un-comment the following to provide a specific roving profile share # the default is to use the user's home directory; [Profiles]; path = / usr / local / samba / profiles; browseable = no ; guest ok = yes # NOTE: If you have a BSD-style print system there is no need to # specifically define each individual printer [printers] comment = All Printers path = / var / spool / samba browseable = no # Set public = YES TO Allow User 'Guest Accent' to Print Guest OK = No Writable = No Printable = YES then generates the user / etc / samba / smbpasswd of Samba. First, Samba's users must exist in the Linux system. If your system already has a large number of users, you can CAT / etc / passwd | mksmbpasswd.sh> / etc / smbpasswd generation / etc / smbpasswd file. At this time, its password has not been set yet. Need SMBPasswd User to set your password.