[安裝 Samba]
- aptitude update
- aptitude upgrade
- aptitude install samba
[設定 Samba]
- nano /etc/samba/smb.conf
- [global]
# NT-Domain-Name or Workgroup-Name
workgroup = WORKGROUP # NT Description field
server string =
# netbios name
netbios name = NAS-01G
display charset = UTF8
dos charset = CP950
unix charset = UTF8
# hide the system files
# hide dot files = yes
# 04/17/2004 Hank Chu : added to tune the throughput of Samba
log level = 0
read raw = yes
write raw = yes
oplocks = yes
max xmit = 65535
getwd cache = yes
stat cache = no
deadtime = 3
hosts allow =
hosts deny =
security = user
guest account = nobody
null passwords = yes
guest only = no
map to guest = Bad User
max log size = 50
encrypt passwords = yes
# socket options = TCP_NODELAY
dns proxy = no
max connections = 10
dfree command = "/bin/df /mnt | grep mnt | cut -b21-31,42-50"
printcap name = /etc/printcap
load printers = yes
printing = lprng
show add printer wizard = no
# ====================
- [printers]
comment = All Printers
path = /mnt/spool/samba
browseable = yes
# Set public = yes to allow user 'guest account' to print
guest ok = yes
writable = yes
printable = yes
printing = lprng
public = yes
print command = /mnt/lpr -P%p -r %s ; echo "/mnt/lpr -P%p -r %s" >> /tmp/print.log
lpq command = /mnt/lpq -P%p ; echo "/mnt/lpq -P%p" >> /tmp/print.log
lprm command = /mnt/lprm -P%p %j ; echo "/mnt/lprm -P%p %j" >> /tmp/print.log
lppause command = /mnt/lpc hold %p %j ; echo "/mnt/lpc hold %p %j" >> /tmp/print.log
lpresume command = /mnt/lpc release %p %j ; echo "/mnt/lpc release %p %j" >> /tmp/print.log
queuepause command = /mnt/lpc -P%p stop ; echo "/mnt/lpc -P%p stop" >> /tmp/print.log
queueresume command = /mnt/lpc -P%p start ; echo "/mnt/lpc -P%p start" >> /tmp/print.log
- [Share]
comment = Share to All
path = /mnt/Share
browseable = yes
public = no
Invalid users = power,guest,
readlist =
writelist = fjufirefox,
directory mode = 0777
create mask = 0777
[使用 Samba]
- 透過 Windows 存取 LS, 檔案總管即可, \\LS-ip
- 透過 Linux 存取 LS, smbmount '//主機名稱/Share' /mnt/samba -o codepage=cp950,iocharset=big5