Check configure file

最後更新: 2023-12-08

目錄

 


Admin

 

sshd -t

fail

sshd -t
/etc/ssh/sshd_config: line 152: Bad configuration option: a
/etc/ssh/sshd_config: terminating, 1 bad configuration options

seccuss

echo $?   # 0

nagios -v nagios.cfg

rsyslogd -N 1                 <-- higher levels will mean more verbosity

 


Web

 

apachectl -t

nignx -t

lighttpd -t

 


Mail

 

postfix [-v] [-c config_dir] check                <-- Warn about bad directory/file ownership or permissions

 


Samba

 

testparm -v

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[FolderA]"
Processing section "[FolderB]"
Processing section "[DFS]"
Unknown parameter encountered: "read-only"
Ignoring unknown parameter "read-only"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

 


DNS

 

named

/usr/sbin/named -u named -t /var/named/chroot

OR

named-checkconf

named-checkconf /etc/named.conf

# chrooted named

named-checkconf -t /var/named/chroot /etc/named.conf

no output ==> configuration is considered correct (只代表 named.conf 沒問題而已)

-z
           Perform a test load of all master zones found in named.conf.

Centos 上的方法:

service named configtest   <-- 同時做了 -t -z

dnsmasq

dnsmasq --test

dnsmasq: syntax check OK.

 


FTP

 

proftpd -t

 


Backup

 

rsnapshot configtest

 


Proxy

 

squid -k check

 


 

 

 

Creative Commons license icon Creative Commons license icon