• 要找福利?记不住网址?搜不到?如何与我们保持联系?试试 CTRL+D 把零点博客添加进您的浏览器收藏夹,一键直达永不失联!

网络通讯-Linux testparm命令

linux系统 涛涛 173次浏览 0个评论

Linux testparm命令用于测试Samba的设置是否正确无误。

执行testparm(test parameter)指令可以简单测试Samba的配置文件,假如测试结果无误,Samba常驻服务就能正确载入该设置值,但并不保证其后的操作如预期般一切正常。

语法

<span class="pln">testparm </span><span class="pun">[-</span><span class="pln">s</span><span class="pun">][配置文件][<主机名称><</span><span class="pln">IP</span><span class="pun">地址>]</span>

参数说明

  • -s 不显示提示符号等待用户按下Enter键,就直接列出Samba服务定义信息。

实例

查看Ssmba配置

<span class="com"># testparm     </span>
<span class="typ">Load</span><span class="pln"> smb config files </span><span class="kwd">from</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">samba</span><span class="pun">/</span><span class="pln">smb</span><span class="pun">.</span><span class="pln">conf
</span><span class="typ">Processing</span><span class="pln"> section </span><span class="str">'[homes]'</span>
<span class="typ">Processing</span><span class="pln"> section </span><span class="str">'[printers]'</span>
<span class="typ">Processing</span><span class="pln"> section </span><span class="str">'[uptech]'</span>
<span class="typ">Processing</span><span class="pln"> section </span><span class="str">'[home]'</span>
<span class="typ">Loaded</span><span class="pln"> services file OK</span><span class="pun">.</span>
<span class="typ">Server</span><span class="pln"> role</span><span class="pun">:</span><span class="pln"> ROLE_STANDALONE
</span><span class="typ">Press</span><span class="pln"> enter to see a </span><span class="kwd">dump</span><span class="pln"> of your service definitions
      </span><span class="com">///按下回车继续</span>
<span class="com"># Global parameters</span>
<span class="pun">[</span><span class="kwd">global</span><span class="pun">]</span><span class="pln">
workgroup </span><span class="pun">=</span><span class="pln"> MYGROUP
server </span><span class="kwd">string</span> <span class="pun">=</span> <span class="typ">Samba</span> <span class="typ">Server</span><span class="pln">
security </span><span class="pun">=</span><span class="pln"> SHARE
encrypt passwords </span><span class="pun">=</span> <span class="typ">No</span><span class="pln">
password server </span><span class="pun">=</span> <span class="kwd">None</span><span class="pln">
log file </span><span class="pun">=</span> <span class="str">/var/</span><span class="pln">log</span><span class="pun">/</span><span class="pln">samba</span><span class="pun">/%</span><span class="pln">m</span><span class="pun">.</span><span class="pln">log
max log size </span><span class="pun">=</span> <span class="lit">50</span><span class="pln">
socket options </span><span class="pun">=</span><span class="pln"> TCP_NODELAY SO_RCVBUF</span><span class="pun">=</span><span class="lit">8192</span><span class="pln"> SO_SNDBUF</span><span class="pun">=</span><span class="lit">8192</span><span class="pln">
printcap name </span><span class="pun">=</span> <span class="str">/etc/</span><span class="pln">printcap
dns proxy </span><span class="pun">=</span> <span class="typ">No</span><span class="pln">
idmap uid </span><span class="pun">=</span> <span class="lit">16777216</span><span class="pun">-</span><span class="lit">33554431</span><span class="pln">
idmap gid </span><span class="pun">=</span> <span class="lit">16777216</span><span class="pun">-</span><span class="lit">33554431</span><span class="pln">
cups options </span><span class="pun">=</span><span class="pln"> raw

</span><span class="pun">[</span><span class="pln">homes</span><span class="pun">]</span><span class="pln">
comment </span><span class="pun">=</span> <span class="typ">Home</span> <span class="typ">Directories</span><span class="pln">
read only </span><span class="pun">=</span> <span class="typ">No</span><span class="pln">
browseable </span><span class="pun">=</span> <span class="typ">No</span>

<span class="pun">[</span><span class="pln">printers</span><span class="pun">]</span><span class="pln">
comment </span><span class="pun">=</span> <span class="typ">All</span> <span class="typ">Printers</span><span class="pln">
path </span><span class="pun">=</span> <span class="str">/var/</span><span class="pln">spool</span><span class="pun">/</span><span class="pln">samba
printable </span><span class="pun">=</span> <span class="typ">Yes</span><span class="pln">
browseable </span><span class="pun">=</span> <span class="typ">No</span>

<span class="pun">[</span><span class="pln">uptech</span><span class="pun">]</span><span class="pln">
comment </span><span class="pun">=</span> <span class="pun">*</span><span class="pln">
path </span><span class="pun">=</span> <span class="str">/home/</span><span class="pln">uptech
read only </span><span class="pun">=</span> <span class="typ">No</span><span class="pln">
guest ok </span><span class="pun">=</span> <span class="typ">Yes</span>

<span class="pun">[</span><span class="pln">home</span><span class="pun">]</span><span class="pln">
comment </span><span class="pun">=</span> <span class="pun">*</span><span class="pln">
path </span><span class="pun">=</span> <span class="pun">/</span><span class="pln">home
read only </span><span class="pun">=</span> <span class="typ">No</span><span class="pln">
guest ok </span><span class="pun">=</span> <span class="typ">Yes</span>

欢迎转载本文:网络通讯-Linux testparm命令
喜欢 (0)
[ld]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址