|
Samba进行文件共享,设计要求:
1.直接访问该服务器,不需要输入任何用户名密码,可以看到所有共享的文件夹
2.访问某些文件夹不需要输入用户名密码,访问某些文件夹需要输入指定用户名密码
但是在设置过程中发现一个很有意思的问题,请各位帮忙看看
smb.conf如下:
[global]
server string = %h server
map to guest = Bad User
obey pam restrictions = Yes
guest account = root
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
unix extensions = No
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
load printers = No
dns proxy = No
panic action = /usr/share/samba/panic-action %d
[homes]
comment = Home Directories
valid users = %S
create mask = 0700
directory mask = 0700
browseable = No
available = No
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No
available = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
available = No
[root$]
comment = Hidden Root
path = /
valid users = root, @root
browseable = No
[Disk2]
comment = MyNAS Disk 2 - 2T
path = /mnt/disk2
valid users = root, @root
read only = No
create mask = 0644
delete readonly = Yes
[Share]
comment = Share - Read only to everyone
path = /mnt/share
guest ok = Yes
wide links = Yes
[ISO]
comment = ISO - Mount iso file/Read only
path = /mnt/iso
guest ok = Yes
[Public]
comment = Public - Read/write to everyone
path = /mnt/public
force user = root
force group = root
read only = No
create mask = 0644
guest ok = Yes
delete readonly = Yes
以上配置可以满足本人设计要求,访问Disk2或者root$的时候需要输入用户名密码,其他均不需要
但是如果我在smb.conf里面加入:
username map = /etc/samba/user.map
user.map内容如下:
root=Administrator admin
加入上面那句配置后,发现访问该文件服务器的时候就需要输入用户名密码,求有什么方法可以在访问该服务器的时候不需要输入用户名密码。 |
|