Samba sharing and access permission settings

Source: Internet
Author: User

1. Introduction

Configure the samba sharing server. Only the IP address 10.0.1.1 is allowed to access the sharing Function of the Samba server. At the same time, the files uploaded in the shared folder cannot be modified or deleted. You need to use the file extension attribute of Linux.

2. Disable the Firewall

Vim/etc/SELinux/config

"SELinux = disabled" or "setenforce 0"

3. Configure iptables policies

Iptables-A input-p tcp-s 10.0.1.1 -- dport 138-J accept

Iptables-A input-p tcp-s 10.0.1.1 -- dport 139-J accept

Iptables-A input-p tcp-s 10.0.1.1 -- dport 145-J accept

Service iptables save

Service iptables restart

Iptables-l-N -- line-Number

4. install and configure samba

# Yum install samba-client samba-common

# Groupadd jiaoyi

# Useradd-G jiaoyi user

# Smbpasswd-a user

# Mkdir/customer_file

# Chmod 777/customer_file

# Chmod + T/customer_file # Set the sticky bit

# Mv/etc/samba/smb. conf/etc/samba/smb. conf. Bak

# Vim/etc/samba/smb. conf

[Global]

NetBIOS name = samba

Workgroup = workgroup

Server String = customer file server

Log File =/var/log/samba/log. % m

Max log size = 50

Security = user

SMB passwd file =/etc/samba/smbpasswd


Displays charset = UTF-8

UNIX charset = UTF-8

DOS charset = UTF-8

Deadtime = 100

Max connections = 100


[Customer_file]

Comment = customer file folder

Path =/customer_file

Public = No

Browseable = Yes

Writable = Yes

Create mask = 1400

Directory mask = 1400

Valid users = @ root, @ jiaoyi

# Service SMB start


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.