English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux testparm command

Linux Command Manual

The Linux testparm command is used to test whether the Samba settings are correct and without errors.

Executing the testparm (test parameter) command can simply test the configuration file of Samba. If the test result is correct, the Samba resident service can correctly load the set value, but it does not guarantee that the subsequent operations will proceed as expected.

Syntax

testparm [-s][Configuration file][<Host name><IP address>]

Parameter description:

  • -s Does not display prompt symbols and waits for the user to press the Enter key before listing Samba service definition information.

Online examples

View Ssmba configuration

# 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
      ///Press Enter to Continue
# 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 Command Manual