Ubuntu12中samba环境搭建与使用

这里简单地整理了下(最好以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, 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值