- 论坛徽章:
- 0
|
安装
apt-get install samba
配置见以下脚本,满足不同权限的需要
cjgs:/etc/samba# cat /etc/samba/smb.conf
#======================= Global Settings =======================
[global]
workgroup = WORKGROUP
server string = %h server
# wins support = no
; wins server = w.x.y.z
dns proxy = no
; name resolve order = lmhosts host wins bcast
dos charset = cp936
unix charset = cp936
display charset = cp936
# Some other performace tuning options
# disable links and symbol links
# follow symlinks = no
# wide links = no
# enable some read/write tuning
# use sendfile = yes
# read raw = yes
# write raw = yes
# aio read size = 16384
# aio write size = 16384
# write cache size = 262144
# max xmit = 65536
# large readwrite = yes
# getwd cache = yes
# disable locking, because only 2 share can be written.
# strict locking = no
# fake oplocks = yes
# oplocks = no
#### Networking ####
; interfaces = 127.0.0.0/8 eth0
; bind interfaces only = yes
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
# syslog only = no
syslog = 0
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
########## Domains ###########
; domain logons = yes
; logon path = \\%N\profiles\%U
; logon drive = H:
; logon script = logon.cmd
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g
########## Printing ##########
# load printers = yes
; printing = bsd
; printcap name = /etc/printcap
; printing = cups
; printcap name = cups
############ Misc ############
; include = /home/samba/etc/smb.conf.%m
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
# domain master = auto
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
; winbind enum groups = yes
; winbind enum users = yes
; usershare max shares = 100
#======================= Share Definitions =======================
[menu]
comment = menu
path = /home/share/menu
read only = yes
guest ok = yes
public = yes
[p4]
comment = p4
path = /home/share/p4
read only = yes
guest ok = yes
public = yes
[80G]
comment = menu
path = /home/share/80G
read only = yes
guest ok = yes
public = yes
[start$]
path = /home/share/start
read only = yes
guest ok = yes
public = yes
writable = no
[log$]
path = /home/share/log
read only = yes
guest ok = yes
write list = @sicent
public = yes
[netgame$]
path = /netgame/game
guest ok = yes
read only = yes
public = yes
write list = @administrator
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/5252/showart_1934357.html |
|