[shared_name] 这个在Windows中显示出来是共享的目录;
path = 可以设置要共享的目录放在哪里;
writeable = 是否可写,这里我设置为可写;
browseable = 是否可以浏览,可以;可以浏览意味着,我们在工作组下能看到共享文件夹。如果您不想显示出来,那就设置为 browseable = no
guest ok = 匿名用户是否允许以guest身份是登录;
第二步:建立目录并设置好权限
[root@linuxidc samba]# mkdir /share/test -pv #递归建立目录
mkdir: 已创建目录 “/share”
mkdir: 已创建目录 “/share/test”
修改samba配置文件,在最后面增加以下几行:
[root@linuxidc samba]# vim smb.conf
[tools]
comment = Share Testing
path = /share/test
public = yes
writable = yes
[root@linuxidc samba]# testparm #查看测试配置文档是否有问题
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[tools]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = Samba Server Version %v
passdb backend = tdbsam
log file = /var/log/samba/%m.log
max log size = 50
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[tools]
comment = Share Testing
path = /share/test
read only = No
guest ok = Yes
第三步:启动smbd和nmbd服务器;
[root@linuxidc samba]# service smb start #启动samba服务
启动 SMB 服务: [确定]
启动 NMB 服务: [确定]
[root@linuxidc samba]# service nmb start #启动nmbd服务
启动 NMB 服务: [确定]