Samba的主配置文件为/etc/samba/smb.conf
主配置文件由两部分构成
Global Settings (55-245行)
该设置都是与Samba服务整体运行环境有关的选项,它的设置项目是针对所有共享资源的。
Share Definitions (246-尾行)
该设置针对的是共享目录个别的设置,只对当前的共享资源起作用。
配置的详细解释和案例可以参见《CentOS 6.3下Samba服务器的安装与配置》 ,写的很详细。
参照做过一遍,基本都通过了,遇到一个小问题,记录一下:
使用本地的client去访问时遇到LANMAN错误
[root@peanuthost share]# smbclient //localhost/public
WARNING: The security=share option is deprecated
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6_4.1]
Server not using user level security and no password supplied.
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED
看提示应该是配置问题,搜索了下,查到一篇《LANMAN error in Samba》,安装给出的方法,在[Globle]中加入
12 client lanman auth = Yes
lanman auth = Yes
重启# service smb restart ,连接依然出错。看了看上面的提示,把client ntlmv2 auth = no也加入进去,重启,OK了:
[root@peanuthost share]# service smb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]
[root@peanuthost share]# smbclient //localhost/public
WARNING: The security=share option is deprecated
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6_4.1]
Server not using user level security and no password supplied.
smb: \>