资讯

展开

公司内网Samba服务器架设及权限设置

作者:快盘下载 人气:

在公司内部打造一个文件管理系统,其作用域仅仅在公司内部,支持在线对文件的修改和保存操作等,同时也要注意权限问题。

公司内网Samba服务器架设及权限设置

1、安装与部署

1.1 利用yum安装samba服务器

[root@localhost ~]# yum install -y samba

1.2 利用groupadd建立用户组

[root@localhost ~]# groupadd management
[root@localhost ~]# groupadd development
[root@localhost ~]# groupadd test
[root@localhost ~]# groupadd user
[root@localhost ~]#

1.3 新建用户并且指定群组

[root@localhost ~]# cat /etc/group | egrep "management|development|test|^user:"
management:x:1001:
development:x:1002:
test:x:1003:
user:x:1004:
[root@localhost ~]#
[root@localhost ~]# useradd D17040009 -g 1001
[root@localhost ~]# useradd D17040010 -g 1002
[root@localhost ~]# useradd D17040011 -g 1003
[root@localhost ~]# useradd D17040012 -g 1004

1.4 新建文件夹并且配置ACL权限

[root@localhost home]# mkdir sam
[root@localhost sam]# mkdir management development test user
[root@localhost sam]# setfacl -m g:development:rwx development/
[root@localhost sam]# setfacl -m g:management:rwx management/
[root@localhost sam]# setfacl -m g:management:rwx development/
[root@localhost sam]# setfacl -m g:management:rwx tset/
[root@localhost sam]# setfacl -m g:management:rwx test/
[root@localhost sam]# setfacl -m g:management:rwx user/
[root@localhost sam]# setfacl -m g:development:rwx test/
[root@localhost sam]# setfacl -m g:development:rwx user/
[root@localhost sam]# setfacl -m g:test:rwx test
[root@localhost sam]# setfacl -m g:test:rwx user
[root@localhost sam]# setfacl -m g:user:rwx user

1.5 修改配置文件

[root@localhost sam]# cat /etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
# workgroup = SAMBA
workgroup = WORKGROUP
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
# load printers = yes
load printers = no
cups options = raw
log file = /var/log/samba/log.%m
max log size = 50
passdb backend = smbpasswd
username map = /etc/samba/smbusers
[smb]
comment = 5M1330
path = /home/sam
writable = yes
browseable = yes
available = yes
#[homes]
# comment = Home Directories
# comment = 5M1330 Directories
# path = /home/vsFTPd
# admin user = root
# valid users = %S, %D%w%S
# valid user = @management,@development,@test,@user
# browseable = yes
# writable = yes
# read only = no
# inherit acls = Yes
# guest ok = no
#[printers]
# comment = All Printers
# path = /var/tmp
# printable = Yes
# create mask = 0600
# browseable = No
#[print$]
# comment = Printer Drivers
# path = /var/lib/samba/drivers
# write list = root
# create mask = 0664
# directory mask = 0775

二、测试

2.1 登陆用户:D17040009 所属组:management

Samba

2.2 登陆用户:D17040010所属组:development

Samba

2.3 登陆用户:D17040011所属组:test

Samba

2.4 登陆用户:D17040012所属组:user

Samba

三、系统维护和故障排除

3.1 无法连接samba服务器

尝试ping一次查看网络能否ping通 查看firewall配置 重启samba服务尝试

3、2 无法创建文件

查看服务器selinux配置 重启samba服务尝试

33 新建用户并且加入群组无法访问应该访问的位置

删除用户再次新建

加载全部内容

相关教程
猜你喜欢
用户评论
快盘暂不提供评论功能!