Network Services --SAMBA Overview and Detailed Profile

A, Samba and samba overview information about the software

1. Samba Overview

  SMB (Server Messages Block, service information block) is a communication protocol for sharing files and printers on a local area network, a local area network that is
providing a shared service resource files and printers among computers with different operating systems within. The SMB protocol is a client / server protocol type, by client
can access the shared file systems on servers, printers and other resources of the Agreement.

2.samba features:

  samba cross-platform, you can realize the file system mount, enabling the server to modify the file

3.samba service software related information

1 Protocol:. SMB / CIFS 
 2 Services:. Smb can share resources, rights verification     
            Port: tcp 139    , tcp445
 3 . Configuration files (/ etc / Samba / ) 
   smb.conf main configuration file
smbusers alias configuration file (the user has to set up set up an alias, you can not set up)

Log In verification mode (security level)

( 1 ) report this content share anonymous authentication: share

( 2 ) User authentication local user (default local authentication)

Development: local user authentication requires a local user, but the password is required (pdbedit -a local user name) to create principles are as follows;

tdbsam: The way is to use a database file to verify. Database file called passdb.tdb. By pdbedit -a add a new user to the database, but to establish a Samba user must first users of the system. It can also be understood as we use pdbedit - A system user to convert samba users. Many parameters pdbedit command, listing several major.

A, pdbeditfds - A username: New Account Samba (samba system user into the user, and set a password)

b, pdbedit - the X-username: Delete Samba account

c, pdbedit - L: lists the Samba user list, read passdb.tdb database files.

( 3 ) the alias user access (similar to virtual users)

It is to set an alias to the user created locally, using an alias plus the original user password to login

Setting method:

   1. / etc / Samba / smbusers alias configuration file, add the following format :( username = alias)
      Format: user = zhangsan

      2. Modify the main configuration file: vim /etc/samba/smb.conf

          Add: username map = / etc / samba / smbusers (added within the first hundred lines, i.e. global configuration added)

       # Allows you to set the alias

Second, common configuration in the file parameters explained

[ , Ltd. Free Join ] (effect globally) to define the overall characteristics of the Samba server, which is valid on all shared resources
  workgroup = WORKGROUP 
  # Set the working group Samba Server to be added or domain. 
  server string = Samba Server Version %v 
  # Set the comment Samba Server, which can be any string, you can not fill. % V represents the Samba version number is displayed.
  interfaces = lo eth0 192.168.12.2/24 
  # Set Samba Server which monitor card, you can write the name of the card, you can also write the IP address of the network card. 
  the allow the hosts = 127 . 192.168 . . 1 . 192.168 . 10.1  
  # represents Samba Server allows connections to clients, a plurality of parameters separated by a space. IP can be a representation, you can also use a network representation. hosts allow hosts deny the opposite (two can not be used). 
  
For example:
. = 172.17.2 EXCEPT172.17.2.50 the allow the hosts # represents the allowable from 172.17.2 * *. Host connections, but excluding 172.17.2.50
     the hosts the allow = 172.17.2.0 / 255.255.0.0 # represents the allowable from 172.17. 2.0 / 255.255.0.0 all hosts in the subnet even    log file = /var/log/samba/log.% # set Samba Server log file storage location and the log file name. After the file name plus a % m (host name), expressed per access Samba Server machines are single log file records a max log size = 5 # Set Samba Server maximum size of the log file, in units of kB , 0 means unlimited
 = the User Security 
# set user access Samba Server authentication methods.
backend = tdbsam passdb
the Load Printers = yes / NO
  # is set to start in Samba when it is shared printer


[Homes] for sharing the user's home directory property (special share , refers to each user's home directory )

  [homes] # shared name ( custom cases can be freely modified )

  comment = Home Directories # shared description

  browseable = no # whether to share can be viewed 

  writable = yes # if shared writable

  valid users =% S # allowed to access the shared user 

    For example: Valid Users = Bob , @bob (a plurality of users or groups, separated by commas, if you want to join a group with '@ group name " represented.)

[printers] to set the printer shared resource properties (special share, shared printing equipment, and now basically no)

  [printers] # shared name

  comment = All Printers # shared described 

  path = / var / spool / samba # shared path 

  browseable = no # whether to share can be viewed 

  guest ok = no # whether anonymous access, similar to the public

  writable = no # is writable

  printable = yes # if you can print

[ Custom ]  custom share area

  [ Custom ] # shared name

  comment = the share is xbz # shared described

  path = / share / zdy # shared path (can be customized, but the need to manually create)

  public = yes # if anonymous access, similar to the guest ok

  browseable = yes # if sharing can be viewed 

  writable = yes # is writable ( at the same time you need to set the shared directory write (w) permission) 

Guess you like

Origin www.cnblogs.com/shenshuilong/p/11030990.html
Recommended