免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2877 | 回复: 6
打印 上一主题 下一主题

[samba] 关于Samba用户只能览指定的目录的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-07 09:50 |只看该作者 |倒序浏览
/share对用户test可见,对test1不可见
1、修改smb.conf ,只在里面添加 config file = /etc/samba/smb.conf.%u 不其他不改变
2、smb.conf.test

  1. #======================= Global Settings =====================================
  2. [global]

  3. # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
  4.    workgroup = MYGROUP

  5. # server string is the equivalent of the NT Description field
  6.    server string = Samba Server

  7. # Security mode. Defines in which mode Samba will operate. Possible
  8. # values are share, user, server, domain and ads. Most people will want
  9. # user level security. See the Samba-HOWTO-Collection for details.
  10.    security = user
  11. # If you want to automatically load your printer list rather
  12. # than setting them up individually then you'll need this
  13.    load printers = yes

  14. # This option tells cups that the data has already been rasterized
  15. cups options = raw
  16. # this tells Samba to use a separate log file for each machine
  17. # that connects
  18.    log file = /var/log/samba/%m.log

  19. # Put a capping on the size of the log files (in Kb).
  20.    max log size = 50
  21. # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
  22. # via DNS nslookups. The default is NO.
  23.    dns proxy = no



  24.         config file = /etc/samba/smb.conf.%u
  25. #============================ Share Definitions ==============================
  26. [homes]
  27.    comment = Home Directories
  28.    browseable = no
  29.    writable = yes
  30. # NOTE: If you have a BSD-style print system there is no need to
  31. # specifically define each individual printer
  32. [printers]
  33.    comment = All Printers
  34.    path = /usr/spool/samba
  35.    browseable = no
  36. # Set public = yes to allow user 'guest account' to print
  37.    guest ok = no
  38.    writable = no
  39.    printable = yes

  40. [share]
  41.         path = /share
  42.         publice = no
  43.         browseable = yes
  44.         writealbe = yes
  45.         write liste = test

复制代码

3、smb.conf.test1

  1. #======================= Global Settings =====================================
  2. [global]

  3. # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
  4.    workgroup = MYGROUP

  5. # server string is the equivalent of the NT Description field
  6.    server string = Samba Server

  7. # Security mode. Defines in which mode Samba will operate. Possible
  8. # values are share, user, server, domain and ads. Most people will want
  9. # user level security. See the Samba-HOWTO-Collection for details.
  10.    security = user
  11. # If you want to automatically load your printer list rather
  12. # than setting them up individually then you'll need this
  13.    load printers = yes

  14. # This option tells cups that the data has already been rasterized
  15. cups options = raw
  16. # this tells Samba to use a separate log file for each machine
  17. # that connects
  18.    log file = /var/log/samba/%m.log

  19. # Put a capping on the size of the log files (in Kb).
  20.    max log size = 50
  21. # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
  22. # via DNS nslookups. The default is NO.
  23.    dns proxy = no



  24.         config file = /etc/samba/smb.conf.%u
  25. #============================ Share Definitions ==============================
  26. [homes]
  27.    comment = Home Directories
  28.    browseable = no
  29.    writable = yes
  30. # NOTE: If you have a BSD-style print system there is no need to
  31. # specifically define each individual printer
  32. [printers]
  33.    comment = All Printers
  34.    path = /usr/spool/samba
  35.    browseable = no
  36. # Set public = yes to allow user 'guest account' to print
  37.    guest ok = no
  38.    writable = no
  39.    printable = yes

  40. [share]
  41.         path = /share
  42.         publice = no
  43.         browseable = yes
  44.         writealbe = yes
  45.         write liste = test
复制代码

在用test1 跟test登入的时候/share目录都没有出现,请问一下要怎么解决??

[ 本帖最后由 lxsong520 于 2008-5-7 09:53 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-05-07 10:11 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
3 [报告]
发表于 2008-05-07 10:35 |只看该作者
可以了,有一个问题:在每一个用户的配置文件中都有config file 这句语句,这样不会产生递归调用吗??

论坛徽章:
0
4 [报告]
发表于 2008-05-07 10:38 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
5 [报告]
发表于 2008-05-07 10:47 |只看该作者
再请教一个问题,
%u | 当前的unix用户名

%U | 被请求的客户端用户名(不总是被samba使用)
这两个有什么区别?

[ 本帖最后由 lxsong520 于 2008-5-7 10:56 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2008-05-07 11:16 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
7 [报告]
发表于 2008-05-07 11:29 |只看该作者
搞定了,,谢谢斑竹~!~!~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP