Install centos samba

Source: Internet
Author: User

Installation environment: centos6.5 iptables to enselinux: enforcing

1. Installation
Yum-y install samba

2. configuration document
Vim/etc/samba/smb. conf
[Global] # global variable settings
Workgroup = workgroup
Server String = Samba server version % v
Security = share # security level: anonymous sharing, user authentication, Domain)
Log File =/var/log/samba/log. % m
Max log size = 50
Load printers = No
Idmap config *: backend = TDB
Hosts allow = 127. 192.168.1. # Set the allowed access range
Cups Options = raw
Browseable = No # list shared directories (no indicates not to list, Yes indicates to list)

[Share] # Set Environment Variables
Comment = public share
Path =/share # Set the shared directory
Guest OK = Yes
Browseable = Yes

If the security level set in the global variables above is user, you need to set network users. The following lists the simplest verification methods:
Add a new
Useradd pop # Add User pop
Su pop # Switch to pop user
Smbpasswd # Set the pop SMB access password. This password is not your boarding password and is only used for Samba access verification.
Add an item to the environment variable.
Invalid users = pop

3. Configure the security environment
3.1 set the firewall. Samba uses ports 445 and 139.
Iptables-A input-s 0/0-I eth0-P TCP -- destination-port 445-J acept #0/0 can be modified to the desired network segment, for example: 192.168.1.1/24
Iptables-A input-s 0/0-I eth0-P TCP -- destination-port 139-J acept

3.2 set SELinux
Chcon-T samba_share_t-r/share # parameter description:-T is used to add rules and-R is recursively modified. In addition, it should be noted that-R must be kept in front of the directory.


install centos samba

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.