Samba service details

Source: Internet
Author: User
Article Title: samba service details. 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.
I have a lot of work reasons when configuring the sambs server, so I will write it down and discuss it with you. This article is for red hat linux 9 samba server configuration.
  
The same side of the dish is helpful. There is no technical content in this article. I am not very familiar with linux. Please advise me.
Smb in the configuration file/etc/samba/of samba server. enter gedit/etc/samba/smb In the conf terminal. conf can also be edited using vi. because the file is too long
  
I personally think that the useless stuff has been deleted, mainly for some comments. I will explain the meaning of the main field below. Because my file has been configured, your machine may be different from mine.
====================================== Global Settings ====================== ======================================
[Global] // set the overall samba service environment
Workgroup = hackase // set the workgroup name
Server string = angel server // server Name Description
  
; Hosts allow = 192.168.1. 192.168.2. 127. // restrict the IP address range that can access this service. The default value is all
If you want to set the settings, remove the preceding ";"
Printcap name =/etc/printcap // printer configuration file
Load printers = yes // whether to share the printer
  
# Bsd, sysv, plp, lprng, aix, hpux, qnx, cups
Printing = cups // printer type. The standard printer types include the above.
  
; Guest account = pcguest // pcguest is the user name. You can remove the ";" to allow the user
The pcguest identity is used for anonymous logon, but the/etc/passwd must contain this person.
  
Log file =/var/log/samba/% m. log // create different log files for users logging on to the server.
  
Max log size = 0 // the size of the log file. "0" indicates no limit.
  
// Set the server security level in the smb. conf file
  
Security = SHARE // There are four security levels: share, user, server, and domain.
  
; Password server = Password verification server.
  
; Password level = 8 // password level
; Username level = 8
  
Encrypt passwords = yes // user password encryption, of course, can also not be encrypted
  
Smb passwd file =/etc/samba/smbpasswd // set the password server to samba server.
You need this stuff to specify the authentication file. This is the file
If the samba server is the specified win
Server is not required
  
; Ssl CA certFile =/usr/share/ssl/certs/ca-bundle.crt
  
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 *
  
Pam password change = yes
  
; Username map =/etc/samba/smbusers // if each windows user has an account for this
No
; Include =/etc/samba/smb. conf. % m
  
Obey pam restrictions = yes
  
; Interfaces = 192.168.12.2/24 192.168.13.2/24 if multiple network segments need to be listed here
  
; Remote announce = 192.168.1.255 192.168.2.44
  
; Local master = no
  
; OS level = 33
  
; Domain master = yes
  
; Preferred master = yes
  
; Domain logons = yes
  
; Logon script = % m. bat
  
; Logon script = % U. bat
  
; Logon path =\\ % L \ Profiles \ % U
  
; Wins support = yes // wins server support
  
; Wins server = w. x. y. z
  
; Wins proxy = yes // wins proxy settings
  
Dns proxy = no // dns proxy settings
  
; Preserve case = no
; Short preserve case = no
  
; Default case = lower
  
; Case sensitive = no
  
#============================ Share Definitions ========== ==================================
[Homes] // set the user's own directory
Comment = Home Directories // description (same as below)
Browseable = no // set the directory to be browsed by others
Writeable = yes // write permission of the user
Valid users = % S
Create mode = 0664
Directory mode = 0775
  
  
; [Netlogon] // set the logon directory for this domain
; Comment = Network Logon Service
; Path =/usr/local/samba/lib/netlogon
; Guest OK = yes
; Writable = no
; Share modes = no
  
; [Profiles]
; Path =/usr/local/samba/profiles
; Browseable = no
; Guest OK = yes
  
[Printers] // printer settings
Comment = All Printers
Path =/var/spool/samba
Browseable = no
  
Printable = yes
  
; [Tmp] // user shared resource settings
; Comment = Temporary file space
; Path =/tmp // you can customize the Directory and remove the ";" from the front.
; Read only = no // whether it is read-only or writable
; Public = yes
  
; [Public] // user sharing resource settings
; Comment = Public Stuff
; Path =/home/samba
; Public = yes
; Writable = yes
; Printable = no
; Write list = @ staff
  
  
; [Fredsprn]
; Comment = Fred's Printer
; Valid users = fred
; Path =/home/fred
; Printer = freds_printer
; Public = no
; Writable = no
; Printable = yes
  
; [Fredsdir]
; Comment = Fred's Service
; Path =/usr/somewhere/private
; Valid users = fred
; Public = no
; Writable = yes
; Printable = no
  
; [Pchome]
; Comment = PC Directories
; Path =/usr/local/pc/% m
; Public = no
; Writable = yes
  
; [Public]
; Path =/usr/somewhere/else/public
; Public = yes
; Only guest = yes
; Writable = yes
; Printable = no
  
; [Myshare]
; Comment = Mary's and Fred's stuff
; Path =/usr/somewhere/shared
; Valid users = mary fred
; Public = no
; Writable = yes
; Printable = no
; Create mask = 0765
  
[My work] // even Dongdong
Comment = is me work
Path =/root/my work
Valid users angel
Public = yes
Writeable = yes
  
_ Content> well, it's easy to understand the smb. conf file. Let's start to explain the four security levels of samba server separately.
  
1. share-level Configuration
  
This is the lowest among the four levels, and the method is also the simplest. We only need to modify the smb. conf file.
  
Workgroup = hackase
  
Server string = angel server
  
Hosts allow = 192.168.1. // the IP address CIDR block that limits 192.168.1 can be prevented.
  
  
Printcap name =/etc/printcap
  
Load printers = yes // share the printer
  
Printing = cups // linux Standard for printers
  
Guest account = angel
  
Log file =/var/log/samba/% m. log
  
Max log size = 20
  
Security = share
========================================================== ======================================
You can use other settings by default, or you can delete all comments. [tmp] This field's ";" removed. the path can be changed. restart the service/etc/samba/smb restart //
  
Service smb restart is also supported
  
Use testparm to test whether the file we configured is correct:
========================================================== ======================================
[Root @ localhost root] # testparm // [printers] Comment out during the test, so there is no such comment here.
Load smb config files from/etc/samba/smb. conf
Processing section "[homes]"
Processing section "[tmp]"
Processing section "[my]"
Loaded services file OK. // if there is an error, the error will be listed here.
Press enter to see a dump of your service definitions
========================================================== ======================================
Run the smbclient command to view network sharing information.
========================================================== ======================================
[Root @ localhost etc] # smbclient-L localhost // The local name is localhost
Password:
Domain = [HACKBASE] OS = [Unix] Server = [Samba 2.2.7a]
  
Sharename Type Comment
--------------------
Tmp Disk Temporary file space
My Disk is me
IPC $ IPC Service (angel server)
ADMIN $ Disk IPC Service (angel server)
Root Printer Home Directories
  
Server Comment
----------------
  
Workgroup Master
----------------
========================================================== ====================================
2. user-level Configuration
  
The user level is a little higher than the share level security level. It is very simple. You can change it based on the share level.
  
Change the security = share field to security = user. Add the following field:
  
Guest
Related Article

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.