Article Title: parsing the configuration file of SambaServer in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Tip: in Linux, you can access Windows hosts in the LAN through the Samba client, or provide services such as files and printers to Windows hosts through the Samba server. Samba uses/etc/samba/smb. conf, as its main configuration file, does not take effect directly until you restart the Samba service using the # service sma restart command.
Samba uses/etc/samba/smb. conf as its main configuration file. Direct modification does not take effect until you are using
# Service sma restart
Command to restart the Samba service. Below are several useful parameters for the smb. conf file:
Workgroup = WORKGROUP-NAME ############## set the name to join a workgroup
Server string = brief comment about server ############# this option is optional and is mainly used to COMMENT on the Samba Service Windows system.
Host allow = 192.168.1. 192.168.2. 127. ############# this item is very important to security. It strictly limits the scope of Samba access. By default, access from all IP addresses is allowed ......
Printcap name =/etc/printcap ############ set the printer configuration file path
Load printers = yes ######## whether to share the printer
Printing = cups ################# printer type. If the printer is of the linux Standard Type, do not change it.
Guest account = pcguest ################# if you want to allow a user to log on as an anonymous user ......; Remove the preceding comments. Make sure the user is in/etc/passwd. The pcguest can be changed to a local user set by the user as needed.
Loginfile =/var/log/samba/% m. log ################### log creates different log files for each logged-in user (Samba user) in this directory.
Passwd Server ################### password verification Server. When you use linux Through Samba in Windows. Automatically send the username and password for logging on to windows to Samba. Then Samba verifies the two information to windows server. If it is incorrect, a dialog box is displayed, asking the user to re-enter the user name and password. The password SERVER can be an NT Server (usually the primary domain controller) or another Samba SERVER. Therefore, if Security = share, delete the line about the password Server.
Password Level-= 8 ######################### Password Level settings
Encrypt password = yes ############## the user password must be encrypted. Because 98/NT currently uses an encrypted password. Therefore, you must use an unencrypted password.
Smb Passwd file =/etc/samba/smbpasswd ############ when you set the password verification server to a Samba server, you need to use this line to specify the password file to be verified. The most important thing is the path set in the password file.
Uin passwd sync = yes
Passwd program =/usr/bin/passwd % u ############## the next two lines are used to update the linux system after the Windows Password is changed. password, make sure that the 'encrypt password' and 'smb passwd file' items are enabled.
Pam password change = yes ############# when a user requests to change the password, use PAM. No Local password Program/user/bin/passwd
Username map =/etc/samba/smbusers ############## set the corresponding user name in this file, for example, root = administrator admin, if every windows user has an account on the samba server, you can leave it unspecified,
Include =/etc/samba/smb. conf % m ############## this line allows you to customize the basic configuration file for each computer, % M indicates the name of the computer NETBIOS is connected.
Obey pam restrictions = yew ############# when a user authenticates, the user must comply with PAM's management restrictions.
Socket options = TCP_NODELAY SO_RCVBUF = 8192 SO_SNDBUF = 8192 ############# set the Socket options for sessions between servers and customers, this setting will optimize the transmission speed.
Interfaces = 192.168.12.2/24 192.168.13.2/24 ############## the multi-network interface must be listed here.
Remote browse sync = 192.168.3.25 192.168.2.255 ############## set Remote Browsing for both the current row and the next row
Remote announce = 192.168.1.255 192.168.2.44
# Browser Control Options
Local master = no
Oslevel = 33
Domain master = yes
Preferred master = yes
Domain logons = yes
Logon script = % M. bat ############# set the logon script for the current row and next row
Logon script = % U. bat
Wins support = yes ############## wins server support
Wins server = w. x. y. z ############## wins client settings
Wins proxy = yes ############## set wins proxy
Dns proxy = no ############# dns proxy settings, which do not perform DNS queries on the client by default
[Homes] ############# settings for users to access their own directories
Browseable = no ############# user's private Directory, which does not need to be browsed by others
Writeable = yes ############# permission for users to write data to their own directories
[Netlogon]
Guest OK = yes
Share modes = no
[Profiles] ############## default profiles settings
[Printer] ############## printer settings
Path =/var/spool/samba ############## a printer pool (spool) user must create a directory
Browseable = no ############# this row stores temporary printer files.
Set public = yes to allow user 'guest prinr ############## if this parameter is set, the guest user can use the printer.
Printable = yes ############## whether the user can print
[Temp]
Read only = no ############## read-only or writable
Public = yes ############## share or not
Configure a share-level server
Workgroup = linux
Hosts allow = 192.168.1. ############## comment out if you do not want to restrict it
Printcap =/etc/printcap
Load printers = yes
Printers = lprng
Guest account = abc ############# specify a user account abc as an existing user account in samba.
Logfiles =/var/log/samba/% m. log
Maxlog size = 50
Security = share
Socket options = TCP_NODELAY SO_RCVBUF = 8192 SO_SNDBUF = 8192
# Note: Other settings may be set by smb. conf by default.
# Restart the service
Test samba command testparm
========================================================== ====================================
Configure a USER-level server
Modify the basic configuration at the share Level:
Security = user
Add:
Guest account = zjz
Encrypt passwords = yes
Smb passwd file =/etc/samba/smbpasswd ############# when the configuration file/etc/smb. the samba password file needs to be set after the user-level setting in conf. Create an smbpasswd account and password. Make it the same as the/etc/passwd account and password.
[1] [2] Next page