Build a Samba service using CentOS

Source: Internet
Author: User

1. Install software
Yum install samba-common samba-swat samba-client
Samba-common // mainly provides the samba server's setting file and setting File Syntax check program testparm
Samba-client // client software. It mainly provides the tool instruction set required when the linux host is used as the client.
Samba-swat // https-based samba Server web configuration interface
Samba // server software for the samba server daemon, shared documents, log rotation, and default options


2. Enable the firewall port
Iptables-I INPUT-p tcp -- dport 139-j ACCEPT
Iptables-I INPUT-p tcp -- dport 445-j ACCEPT
Service iptables save


3. Start the Samba service at startup.
Chkconfig smb on
Service smb start

Check that the samba service is enabled.
Ps-ef | grep smb
Root 1183 1 0? 00:00:00 smbd-D
Root 1186 1183 0? 00:00:00 smbd-D
Root 1188 1106 0 000:00:00 pts/0 grep smb

4. Configuration
[Global]

Workgroup = MYGROUP
Hosts allow = 127. 192.168. --> Add an IP prefix that allows access to the samba server
Security = share
Description: sets the authentication method for users to access the Samba Server. There are four authentication methods.
. Share: users do not need to provide user names and passwords to access the Samba Server, and the security performance is low.
. 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.
. 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.
. Domain: the domain security level. The primary domain controller (PDC) is used for authentication.
[Homes]
It mainly refers to what rules and constraints samba users use to access their home directories.
Browseable = yes
Writable = yes


If browseable is set to yes and writable is set to yes, the logged-on samba user can both read and write their own home directories.
5. Use testparm to test configuration correctness
# Testparm
Load smb config files from/etc/samba/smb. conf
Rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.


6. Configure SWAT-Samba WEB management tool


A. Edit the configuration file/etc/xinetd. d/swat.
Vim/etc/xinetd. d/swat


Service swat
{
Port = 901 ------ listening port
Socket_type = stream
Wait = no
Only_from = 0.0.0.0 ----- allow all access
User = root
Server =/usr/sbin/swat
Log_on_failure + = USERID
Disable = no -------- Enabled
}

B. Open the port
Iptables-I INPUT-p tcp -- dport 901-j ACCEPT
C. Start the service
Service xinetd restart
D. Open http: // ip: 901 in the browser and log on with the root account and password.

_______________________________________

Example:
A: create A Public share. Anonymous Users have the permission to upload and download files.
A. Create a Public folder
Mkdir/var/Public
Chmod-R nobody: nobody/var/Public


Drwxr-xr-x 2 nobody 4096 Mar 5 Public


B. modify the configuration file
Vim/etc/samba/smb. conf
#============== Global Settings ====================
Security = share

#============= Share Definitions ====================

[Public]
Comment = Public
Path =/var/Public
Browseable = yes
Writable = yes
Guest OK = yes
C. Restart the service
Service smb restart

Samba details: click here
Samba: click here

Samba file sharing-heterogeneous Communication

The speed of accessing samba from Ubuntu dual Nic of VMWare Virtual Machine doubles

Add the Samba File Sharing Server to the Windows Server 2003 Domain

Samba installation Configuration

Samba service configuration in CentOS 6.2

How to Build the Win7 + VMware + Fedora18 Samba Server

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.