码迷,mamicode.com
首页 > 其他好文 > 详细

samba共享和访问权限设置

时间:2014-08-14 16:59:29      阅读:585      评论:0      收藏:0      [点我收藏+]

标签:samba   iptbales   sticky bit   

1、简介

配置samba共享服务器,只允许10.0.1.1这个ip访问samba服务器的共享功能,同时设置共享文件夹中上传的文件不能被修改和删除,需要用到linux的文件扩展属性

2、关闭防火墙

vim /etc/selinux/config

"SELINUX=disabled"或者"setenforce 0"

3、配置iptables策略

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、安装配置samba

# yum install samba samba-client samba-common

# groupadd jiaoyi

# useradd -g jiaoyi user

# smbpasswd -a user

# mkdir /customer_file

# chmod 777 /customer_file

# chmod +t /customer_file #设置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


display 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


samba共享和访问权限设置,布布扣,bubuko.com

samba共享和访问权限设置

标签:samba   iptbales   sticky bit   

原文地址:http://kimileonis.blog.51cto.com/5531747/1539884

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!