Install samba Service
# apt-get install samba
Create a samba share directory service
# mkdir /share
Create a user and a service restrictions samba group
#useradd public has been pressing the Enter key to create good
Check to see if the user has been created
-At # ls / home
drwx------ 2 public public 4096 12月 27 18:19 public
Configuring samba service configuration file, do not worry if your changes, you can look back up configuration files
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# vim /etc/samba/smb.conf
[report this content share] # shared name for the report this content share
the Comment = Samba Home Directory # comment, share information describing
path = / report this content share # specify shared path
browseable = yes # Allow visible to everyone
Writable = yes # supports user-writable
read only = No # supports only the permission to read
the Guest the ok = yes # whether to allow anonymous access is valid only when the global setting security = share when (yes or NO)
Force the User = public # valid list of accounts
Force group = public # valid lists
force directory mode = 0775 default permissions to create a directory of the client #
User profile support is pblic, you will need to modify / share directory permissions
# chown public:public /share
You configure the file restart the samba service
# service samba restart
Check the samba service is configured successfully: Enter the ip address of the Linux file system in the windows system, and then create the directories and files
samba.conf file configuration in detail:
Introduction to Samba configuration file is very clear, all settings are carried out in /etc/samba/smb.conf configuration file by modifying the configuration file we can configure an anonymous Samba file server, file server, or on account of print server, the default Samba home directory will open a local account sharing and printer sharing, or the configuration file to #; behavior at the beginning of the symbol comment line, the configuration file is divided into several sections, all other segments except global (global configuration section) of is used to describe the shared resource, configuration represents the global valid global segment, the default setting is global. But if the setting items and setting items shared segment in the global configuration section there is a conflict, the setting is set to share the actual effective value segment. Here is the meaning of the various configuration options.
[Global] # define a global strategy
workgroup = MYGROUP # define the working group.
server string = Samba Server Version %v
Tip # server string, the default display samba version, it is recommended to change the default value to prevent attacks against the network version.
;interfaces = lo eth0 192.168.1.5/24 192.168.1.6/24
# If your server has multiple network interfaces, you can specify specify which network interfaces Samba # interfaces by listening options.
;hosts allow = 127. 192.168.2. 192.168.1. EXCEPT 192.168.1.7
# Specify which hosts are entitled to only allow access to Samba server resources (white list), this parameter can be placed in the global
# Segment can also be placed in a shared segment. In contrast to the hosts deny option is used to set the blacklist, available here
# Allow access to the specified host name, IP address or network segment, when the segment can be used to specify or 192.168.12
# 192.168.12.0 / 255.255.255.0 format, you can use EXCEPT to exclude specified IP addresses.
log file = /var/log/samba/log.%m
# Define a log file, because it uses Samba variable% m, so each will have access to shared hosting independent
# Log files in% m will be replaced with the host name of the client.
max log size = 50 # log single file defined maximum capacity of 50K.
security = user
# Set security options will affect the way clients access samba is one of the important options. Security
# Can be set to uesr, share, server or domain, user representatives, through the identity of a user name, password verification visit # Inquirer, # accounts need to be the server machine system account; share on behalf of anonymous access; server on behalf of access based on the authenticated , # but the account information stored on another SMB server; # same access domain-based authentication, account information stored in active directory #.
passdb backend = tdbsam
# Account and password storage, smbpasswd representatives to use the old account and password stored in clear text; tdbsam on behalf of the ciphertext storage format TDB based; ldapsam representative uses LDAP to store account information.
deadtime = 10 # Samba client does not open any resource within 10 minutes, then automatically stop the service, a large number of concurrent access environment
# This setting can provide server performance.
display charset = UTF8 # Set the display character set used is UTF8
max connections = 0 # set the maximum number of connections, 0 means no limit, exceeding this limit connection request the server rejects the connection.
guest account = nobody # set the anonymous account to nobody
load printers = yes # if a shared printer
cups options = raw # Print Properties
[Homes] # shared name
comment = Home # comment, share descriptive information
browseable = no # whether the browser can be
writable = yes # if you can write
[Printers] # Printer Sharing
comment = Printers
path = / var / spool / samba # printer sharing pool
browseable = no
guest ok = no
writable = no
printable = yes
[Common] # shared common name
comment = Common share # annotation, information sharing described
path = / home # specify the shared path
valid users = public # valid account list
create mask = 0755 # client default permissions to upload files, the default is 0744
directory mask = 0775 # client default permissions to create a directory, the default is 0755
browseable = yes # Allow visible to everyone
writable = no # is not writable
write list = public # account read and write permissions list, here is tom writable
admin users = public # shared the administrator has full permissions
invalid users = root # prohibit root access common share
guest ok = no # whether to allow anonymous access, only if valid (yes or no) when the global settings security = share
~