在我的device 有兩個wifi interface
eth0 : 192.168.0.1
eth1 : 192.168.1.1
我想要不同interface進來的人可以存取不同的資料夾,
ex:
eth0 --> folder2
eth1 --> folder1, folder2
但有個問題就是要隱藏不能存取的資料夾,
也就是說eth0 進來的人不能看到folder1...
但我不知道如何設定, 請大家幫忙~
samba server 必須要匿名登入..
smb.conf
#===== Global Settings =====
[global]
workgroup = MYGROUP
server string = Samba Server
security = share
load printers = no
log file = /var/log/samba/log.%m
max log size = 50
dns proxy = no
guest account = root
#===== Share Definitions =====
[folder1]
path = /media/card/
browseable = yes
writable = yes
guest ok = yes
read only = no
public = yes
hosts allow = 192.168.1.
hosts deny = ALL
[folder2]
path = /media/card/public
browseable = yes
writable = yes
guest ok = yes
read only = no
public = yes
有一種做法——在smb.conf中include到不同的設定檔,
include = /etc/samba/smb-%i.conf
就可以分別在"smb-192.168.0.1.conf"和"smb-192.168.1.1.conf"設定不同的分享
小弟有簡單測試過並簡單紀錄下做法,如果合用可以再討論
http://beckjottings.blogspot.tw/2010/10/samba.html
這個方法我也有想過, 但好像會看到兩個server, 可以隱藏不需要看到的server嗎?
如果你用IP去分設定檔,就不用設netbios aliases,就不會有多個SERVER NAME
像這樣嗎?? 可是我都看不到serverㄝ?
smb.conf
#===== Global Settings =====
[global]
workgroup = MYGROUP
server string = Samba Server
security = share
load printers = no
smb ports = 139 445
log file = /var/log/samba/log.%m
max log size = 50
dns proxy = no
guest account = root
bind interfaces only = True
interfaces = eth0 eth1
include = /etc/samba/smb-%i.conf
========smb-192.168.0.30=============
workgroup = groupA
netbios name = SDCARD
[sdcard]
comment = SDcard Share
path = /media/card/
read only = no
guest ok = Yes.conf
sorry, 好像是我的.conf file name 打錯了..我在看看有沒有其他問題。