Configuring Samba servers under Linux (for example, CentOS6.7)

Source: Internet
Author: User

I. Introduction (Baidu Encyclopedia)

Samba is a free software that implements the SMB protocol on Linux and UNIX systems, consisting of servers and client programs. SMB (Server Messages block, information service blocks) is a kind of communication protocol for sharing files and printers on LAN, which provides shared services of files and printers among different computers in LAN. The SMB protocol is a client/server protocol that allows clients to access shared file systems, printers, and other resources on the server. By setting up "NetBIOS over TCP/IP", Samba will not only share resources with local network hosts, but also share resources with computers around the world.

Second, the configuration steps

1. Install the Samba server:

Yum Install-y Samba

2. Backing up the configuration file

Cp/etc/samba/smb.conf/etc/samba/smb.conf.bak

3. Configuration files

VI / etc/samba/smb.conf

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/82/DF/wKioL1djhInDO3ZpAABilkvI0Pg000.jpg-wh_500x0-wm_3 -wmp_4-s_2997251680.jpg "title=" 2.jpg "alt=" Wkiol1djhindo3zpaabilkvi0pg000.jpg-wh_50 "/>

4. Change the user and group to which the file belongs

Shared directory:/tmp/samba and/tmp/sam shared directory

Set shared directory permissions: Chown-r Nobody:nobody/tmp/samba

chown-r Nobody:nobody/tmp/sam

5. Start the Samba service, the launcher please configure the firewall and SELinux;

(Note: The following comments refer to the Wjlkoorey blog post link: http://blog.chinaunix.net/uid-23069658-id-3142052.html

On the issue of Iptables:

Ordinary youth: Knocking directly at the command line ...

Service iptables stop.

Literary youth: Knocking at the command line in turn ...

Iptables-i rh-firewall-1-input 5-m State--state new-m tcp-p TCP--dport 139-j ACCEPT

Iptables-i rh-firewall-1-input 5-m State--state new-m tcp-p TCP--dport 445-j ACCEPT

Iptables-i rh-firewall-1-input 5-p udp-m UDP--dport 137-j ACCEPT

Iptables-i rh-firewall-1-input 5-p udp-m UDP--dport 138-j ACCEPT

Iptables-save

Service Iptables Restart


Again, on the issue of SELinux: (This is a hell of a hole in me)

Ordinary youth: Knocking directly at the command line ...

Setenforce 0

Vi/etc/selinux/config

Changing the selinux=enforcing to Selinux=disabled is no longer performed Setenfore save time after rebooting.

Literary youth: Knocking at the command line in turn ...

Setsebool-psamba_enable_home_dirs on

SETSEBOOL-PSAMBA_EXPORT_ALL_RW on

After that, then: getsebool-a | grep Samba One, you know ...


/ETC/INIT.D/SMB Restart (start)

6. Set as self-starter

Chkconfig SMB on

7. Whether the test was successful

Linux under: Input command # testparm appears similar;

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/E0/wKiom1djhJSw_8w9AACLdrTKzpA224.jpg-wh_500x0-wm_3 -wmp_4-s_1472579697.jpg "title=" 3.jpg "alt=" Wkiom1djhjsw_8w9aacldrtkzpa224.jpg-wh_50 "/>

Under window: In the Resource Path field, enter: \\192.168.1.3 (the IP address of the server you configured) to see the files you created.

8. More detailed configuration combined with case I recommend you to read this blog, Link: http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html



This article is from the "Li Xiaodong" blog, make sure to keep this source http://lixiaodong2016.blog.51cto.com/11693292/1790264

Configuring Samba servers under Linux (for example, CentOS6.7)

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.