Common Parameters of Samba configuration files

Source: Internet
Author: User
Common Parameters of Samba configuration files

The main configuration file of Samba is smb. conf, which is in the/etc/samba/directory by default.
Smb. conf contains multiple segments. Each segment starts from the segment name until the next segment name. Each segment name is placed in the middle of square brackets. The parameter format of each segment is: Name =. The configuration file contains a segment name and parameter. The segment name and parameter name are case-insensitive.
Except for the [Global] segment, all segments can be considered as a shared resource. The segment name is the name of the shared resource, and the parameter in the segment is the attribute of the shared resource.
After Samba is installed, run the testparm command to test whether the smb. conf configuration is correct. Use the testparm-V command to list the configuration parameters supported by smb. conf. After modifying smb. conf, do not forget to restart the smbd and nmbd services.

Global parameters:
========================== Global settings ============================
[Global]

Config file =/usr/local/samba/lib/smb. conf. % m
Note: config file allows you to use another configuration file to overwrite the default configuration file. If the file does not exist, this option is invalid. This parameter is useful and makes Samba configuration more flexible. A samba server can simulate multiple servers with different configurations. For example, if you want pC1 (host name) to use its own configuration file when accessing the Samba server, configure an SMB name for pC1 under/etc/samba/host. conf. pC1 file, and then in SMB. add: config file =/etc/samba/host/SMB to Conf. conf. % m. In this way, when pC1 requests to connect to the Samba server, smb. conf. % m is replaced with smb. conf. pC1. In this way, for pC1, The SAMBA service it uses is defined by smb. conf. pC1, while other machines still use smb. conf to access the Samba server.

Workgroup = workgroup
Note: Set the workgroup or domain to which the Samba server is to join.

Server String = Samba server version % v
Note: Set the Samba server comment, which can be any string or not. Macro % V indicates that the samba version is displayed.

NetBIOS name = smbserver
Note: Set the NetBIOS Name of the Samba server. If this parameter is not specified, the first part of the DNS name of the server is used by default. Do not set NetBIOS Name and workgroup name to the same.

Interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
Note: set which NICs the Samba server listens to. You can write the NIC name or the IP address of the NIC.

Hosts allow = 127. 192.168.1. 192.168.10.1
Description: allows you to connect to the Samba Server Client. Multiple parameters are separated by spaces. It can be expressed by an IP address or a CIDR block. Hosts deny is the opposite of hosts allow.
Example: hosts allow = 172.17.2.20.t172.17.2.50
Allow host connection from 172.17.2. *. *, but exclude 172.17.2.50
Hosts allow = 172.17.2.0/255.255.255.0.0
Allow all host connections from the 172.17.2.0/255.255.0.0 Subnet
Hosts allow = M1, M2
Allow connections from M1 and M2 computers
Hosts allow = @ XQ
Allow all computers from the XQ domain to connect

Max connections = 0
Note: Max connections is used to specify the maximum number of connections to the Samba server. If the number of connections is exceeded, new connection requests are rejected. 0 indicates no restriction.

Deadtime = 0
Note: deadtime is used to set the time for disconnecting a connection that does not open any file. The Unit is minutes. 0 indicates that the Samba server does not automatically disconnect any connection.

Time Server = yes/no
Note: Time Server is used to set the time server for making nmdb a Windows client.

Log File =/var/log/samba/log. % m
Note: Set the storage location and name of the Samba server log file. Add a macro % m (host name) after the file name to record a log file for each machine accessing the Samba server. If pC1 and PC2 have accessed the Samba server, log. pC1 and log. PC2 are left in the/var/log/samba directory.

Max log size = 50
Note: set the maximum size of Samba server log files, in KB. 0 indicates no limit.

Security = user
Description: sets the authentication method for users to access the Samba server. There are four authentication methods.
1. Share: users do not need to provide user names and passwords to access the Samba server, and their security performance is low.
2. User: the Samba server shared directory can only be accessed by authorized users. The Samba server is responsible for checking the correctness of accounts and passwords. The account and password must be created in this Samba server.
3. SERVER: relies on other Windows NT/2000 or Samba server to verify the user's account and password. It is a proxy authentication. In this mode, the system administrator can centralize all Windows users and passwords on an NT System and use Windows NT for Samba authentication. The remote server can automatically authenticate all users and passwords, if authentication fails, Samba uses the user-level security mode as an alternative.
4. Domain: domain security level. The primary domain controller (PDC) is used for authentication.
......
[Read the full text]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.