在公司内部打造一个文件管理系统,其作用域仅仅在公司内部,支持在线对文件的修改和保存操作等,同时也要注意权限问题。
[root@localhost ~]# yum install -y samba
[root@localhost ~]# groupadd management [root@localhost ~]# groupadd development [root@localhost ~]# groupadd test [root@localhost ~]# groupadd user [root@localhost ~]#
[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
[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
[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
尝试ping一次查看网络能否ping通 查看firewall配置 重启samba服务尝试
查看服务器selinux配置 重启samba服务尝试
删除用户再次新建
/etc/sysconfig/network和/etc/sysconfig/network-scripts/ifcfg-eth区别