这里简单地整理了下(最好以root身份来执行以下命令):
# ready: update source
apt-get update
# install samba software
apt-get install samba
apt-get install smbfs
# create samba shared folder
mkdir /home/zcm/work
# config samba: vi /etc/samba/smb.conf
security = user
username map = /etc/samba/smbusers
[global]
workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
# share folder by samba
[share]
comment = global sharing folder
read only = no
locking = no
path = /share
guest ok = yes
[work]
comment = zcm_work
path = /home/zcm/work
public = yes
writable = yes
valid users = zcm
create mask = 0700
directory mask = 0700
browseable = yes
# set password for samba user
smbpasswd -a zcm
# restart samba service
/etc/init.d/smbd restart
# delete samba user
smbpasswd -x zcm
完整的/etc/samba/smb.conf配置文件内容为:
[root@samba #44]#cat smb.conf
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
# server string is the equivalent of the NT Description field
server string = %h server (Samba,