Samba配置文件常用参数详解

xiaoxiao2021-02-28  46

NMB is the NetBIOS name resolution protocol. 

When you configure your system for Samba, it will run both smbd and nmbd daemons. 

One of them (smbd) will take care of the file transfer, etc., 

while the other (nmbd) will take care of the NetBIOS name resolution thus making it possible 

for the hosts to show up in your "Network Neighborhood" in the Windows boxes.

I've seen this problem before when the Linux or UNIX system is the only one in the network providing 

Samba services and yet the /etc/smb.conf file does not specify that this is thedomain master 

(domain master = yes).  In those cases, the Linux box keeps looking around for a master that doesn't

exist and it usually causes these problems.

Perhaps there are other instances where the error message could show up (incorrect workgroup information,

I guess, would be another one), but I've definitely seen it in the situation I described here.

Samba配置文件常用参数详解 Samba的主配置文件叫smb.conf,默认在/etc/samba/目录下。 smb.conf含有多个段,每个段由段名开始,直到下个段名。每个段名放在方括号中间。 每段的参数的格式是:名称=[ ]。配置文件中一行一个段名和参数,段名和参数名不分大小写。 除了[global]段外,所有的段都可以看作是一个共享资源。段名是该共享资源的名字,段里的参数是该共享资源的属性。 Samba安装好后,使用testparm命令可以测试smb.conf配置是否正确。使用testparm –v命令可以详细的列出smb.conf支持的配置参数。 security = user 说明:设置用户访问Samba Server的验证方式,一共有四种验证方式。 1. share:用户访问Samba Server不需要提供用户名和口令, 安全性能较低。 2. user:Samba Server共享目录只能被授权的用户访问,由Samba Server负责检查账号和密码的正确性。账号和密码要在本Samba Server中建立。 3. server:依靠其他Windows NT/2000或Samba Server来验证用户的账号和密码,是一种代理验证。此种安全模式下,系统管理员可以把所有的Windows用户和口令集中到一个NT系统上,使用Windows NT进行Samba认证, 远程服务器可以自动认证全部用户和口令,如果认证失败,Samba将使用用户级安全模式作为替代的方式。 4. domain:域安全级别,使用主域控制器(PDC)来完成认证。 passdb backend = tdbsam 说明:passdb backend就是用户后台的意思。目前有三种后台:smbpasswd、tdbsam和ldapsam。sam应该是security account manager(安全账户管理)的简写。 1.smbpasswd:该方式是使用smb自己的工具smbpasswd来给系统用户(真实 用户或者虚拟用户)设置一个Samba密码,客户端就用这个密码来访问Samba的资源。smbpasswd文件默认在/etc/samba目录下,不过有时候要手工建立该文件。 2.tdbsam:该方式则是使用一个数据库文件来建立用户数据库。数据库文件叫passdb.tdb,默认在/etc/samba目录下。passdb.tdb用户数据库可以使用smbpasswd –a来建立Samba用户,不过要建立的Samba用户必须先是系统用户。我们也可以使用pdbedit命令来建立Samba账户。pdbedit命令的参数很多,我们列出几个主要的。 pdbedit –a username:新建Samba账户。 pdbedit –x username:删除Samba账户。 pdbedit –L:列出Samba用户列表,读取passdb.tdb数据库文件。 pdbedit –Lv:列出Samba用户列表的详细信息。 pdbedit –c “[D]” –u username:暂停该Samba用户的账号。 pdbedit –c “[]” –u username:恢复该Samba用户的账号。 3.ldapsam:该方式则是基于LDAP的账户管理方式来验证用户。首先要建立LDAP服务,然后设置“passdb backend = ldapsam:ldap://LDAP Server” encrypt passwords = yes/no 说明:是否将认证密码加密。因为现在windows操作系统都是使用加密密码,所以一般要开启此项。不过配置文件默认已开启。 smb passwd file = /etc/samba/smbpasswd 说明:用来定义samba用户的密码文件。smbpasswd文件如果没有那就要手工新建。

转载请注明原文地址: https://www.6miu.com/read-52929.html

最新回复(0)