SAMBA configuration and discussion

Source: Internet
Author: User
Shared SMB (servermessageblock) Service Message Block protocol linux can be used. sambasamba is required between nfsnetworkfilesystemlinux and windows to use netbios (networkbasicinputandoutputsystem) netbeui (netbiosexteneduserinterface) samba through two daemon

SMB (server message block) Service message block Protocol

 

Nfs network can be used for linux-based sharing.FileSystem
Samba is required between linux and windows.
Samba uses netbios (network basic input and output system)
Netbeui (netbiosExTenEdUser interface)


Samba is controlled by two daemon
Nmbd is used to manage working groups, netbios name parsing, and other udp port 137,138


Smbd is used to manage the directories shared by samba hosts, file tCp139,445

Features:
1. Support for more detailed Access Control
2. cross-platform (linux and windows) File Sharing

You can log on to the official website.

Http://www.samba.org

The configuration is as follows:

[Root @ li ~] # Yum list |GrepSamba
This system is not registered with RHN.
RHNSuPport will be disabled.
Samba-common.i386-Public toolkit, including samba. conf and test tool testpa for detecting its syntaxRm
Samba. i386 -- samba Server
Samba-client.i386-client tool commands
Samba-swat.i386-graphical samba Configuration tool for web interfaces
[Root @ li ~] # Yum install samba *-y


Server-side master configuration file:/etc/samba/smb. conf
File/etc/samba/lmhosts corresponding to netbios Name and ip address
Password to store files:/etc/samba/passdb. tdb -- use samPasswd-A is added to the user.
Log File:/var/log/samba/


Man smb. conf -- search for help

[Root @ li ~] #Cat/Etc/samba/smb. conf | grep-v ^ # | grep-v ^ $ | grep-v ^ ";" | grep-v "#"

[Global] -- Define global Parameters
Workgroup = MYGROUP -- Define a workgroup
Server sTrIng = Samba Server Version % v -- defines the Server description
Security = user -- defines the working mode: share, user, domain, ads
Passdb backend = tdbsam -- use the local. tdb file to save the account and password
Load printers = yes -- load the printer
Cups options = raw -- printer type
[Homes] -- reserved Resource Name
Comment = Home Directories
Browseable = no
Writable = yes
[Printers] -- reserved Resource Name
Comment = All Printers
Path =/var/spool/samba
Browseable = no
Guest OK = no
Writable = no
Printable = yes


Security =
Share without password, including anonymous users
User uses samba's own password database
Server, domain, ads use the password of the external host

Shared directory Parameters

Whether browseable is visible
Public allows all users who can log on to the console to view
Guest OK is the same as public. You can use either of them.
Writable?
Whether read-only is read-only. This parameter conflicts with writable at the same time, and the Setting Value in the future is the main one.
Create modeUmaskSimilar
ValIdUsers




/Etc/init. d/smb start

[Root @ li ~] # NetStat-Ntlup | grep bd
Tcp 0 0 0.0.0.0: 139 0.0.0.0: * LISTEN 3000/smbd
Tcp 0 0 0.0.0.0: 445 0.0.0.0: * LISTEN 3000/smbd
Udp 0 0 10.1.1.45: 137 0.0.0.0: * 3003/nmbd
Udp 0 0 10.1.1.46: 137 0.0.0.0: * 3003/nmbd
Udp 0 0 192.168.195.1: 137 0.0.0.0: * 3003/nmbd
Udp 0 0 192.168.205.1: 137 0.0.0.0: * 3003/nmbd
Udp 0 0 0.0.0.0: 137 0.0.0.0: * 3003/nmbd
Udp 0 0 10.1.1.45: 138 0.0.0.0: * 3003/nmbd
Udp 0 0 10.1.1.46: 138 0.0.0.0: * 3003/nmbd
Udp 0 0 192.168.195.1: 138 0.0.0.0: * 3003/nmbd
Udp 0 0 192.168.205.1: 138 0.0.0.0: * 3003/nmbd
Udp 0 0 0.0.0.0: 138 0.0.0.0: * 3003/nmbd

 


Lab 1:

Use the linux client tool for testing:
Smbclient-Ftp-Like client to access SMB/CIFS resources
On servers

[Root @ li ~] # Smbclient-L // 10.1.1.45
Password: -- press enter to log on as an anonymous user, but no shared resources are displayed. Only basic information about the server is displayed.

[Root @ li ~] # Smbclient-L // 10.1.1.45-U a -- use the user name to log on, Login Failed
Password:
SessionSetUp failed: NT_STATUS_LOGON_FAILURE


Cause:
1. security = user mode by default. This mode specifies that the password is required for access to the user, except for anonymous users.
2. the samba account has two requirements: 1. The requirement is system user 2.CommandAdd it to the samba Service

Smbpasswd-change a user's SMB password

[Root @ li ~] # Smbpasswd-a -- Add User a to the samba user

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.