歡迎您光臨本站 註冊首頁

關於Samba用戶只能覽指定的目錄的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於Samba用戶只能覽指定的目錄的問題

/share對用戶test可見,對test1不可見
1、修改smb.conf ,只在裡面添加 config file = /etc/samba/smb.conf.%u 不其他不改變
2、smb.conf.test

#======================= Global Settings =====================================


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

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

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

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

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



        config file = /etc/samba/smb.conf.%u
#============================ Share Definitions ==============================

   comment = Home Directories
   browseable = no
   writable = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer

   comment = All Printers
   path = /usr/spool/samba
   browseable = no
# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = yes


        path = /share
        publice = no
        browseable = yes
        writealbe = yes
        write liste = test


3、smb.conf.test1

#======================= Global Settings =====================================


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

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

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

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

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



        config file = /etc/samba/smb.conf.%u
#============================ Share Definitions ==============================

   comment = Home Directories
   browseable = no
   writable = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer

   comment = All Printers
   path = /usr/spool/samba
   browseable = no
# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = yes


        path = /share
        publice = no
        browseable = yes
        writealbe = yes
        write liste = test

在用test1 跟test登入的時候/share目錄都沒有出現,請問一下要怎麼解決??

[ 本帖最後由 lxsong520 於 2008-5-7 09:53 編輯 ]
《解決方案》


config file = /etc/samba/smb.conf.%u


改成



config file = /etc/samba/smb.conf.%U



試試看
《解決方案》

可以了,有一個問題:在每一個用戶的配置文件中都有config file 這句語句,這樣不會產生遞歸調用嗎??
《解決方案》

config file  只能在主配置文件中體現
《解決方案》

再請教一個問題,
%u | 當前的unix用戶名

%U | 被請求的客戶端用戶名(不總是被samba使用)
這兩個有什麼區別?

[ 本帖最後由 lxsong520 於 2008-5-7 10:56 編輯 ]
《解決方案》

用大腦使勁想一下
《解決方案》

搞定了,,謝謝斑竹~!~!~

[火星人 ] 關於Samba用戶只能覽指定的目錄的問題已經有471次圍觀

http://coctec.com/docs/service/show-post-30685.html