Linux testparm命令

Linux 命令大全 Linux 命令大全

Linux testparm命令用于測(cè)試Samba的設(shè)置是否正確無誤。

執(zhí)行testparm(test parameter)指令可以簡(jiǎn)單測(cè)試Samba的配置文件,假如測(cè)試結(jié)果無誤,Samba常駐服務(wù)就能正確載入該設(shè)置值,但并不保證其后的操作如預(yù)期般一切正常。

語法

testparm [-s][配置文件][<主機(jī)名稱><IP地址>]

參數(shù)說明

  • -s 不顯示提示符號(hào)等待用戶按下Enter鍵,就直接列出Samba服務(wù)定義信息。

實(shí)例

查看Ssmba配置

# testparm     
Load smb config files from /etc/samba/smb.conf
Processing section '[homes]'
Processing section '[printers]'
Processing section '[uptech]'
Processing section '[home]'
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
      ///按下回車?yán)^續(xù)
# Global parameters
[global]
workgroup = MYGROUP
server string = Samba Server
security = SHARE
encrypt passwords = No
password server = None
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = /etc/printcap
dns proxy = No
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
cups options = raw

[homes]
comment = Home Directories
read only = No
browseable = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[uptech]
comment = *
path = /home/uptech
read only = No
guest ok = Yes

[home]
comment = *
path = /home
read only = No
guest ok = Yes

Linux 命令大全 Linux 命令大全