如何在nagios服务器上配置htdigest
时间:2019-08-20 17:58:12 来源:igfitidea点击:
从安全角度来看,使用htdigest比htpasswd更好,
因为htpaswd使用是的明文用户名和密码,而htdigest使用加密方法。
操作步骤:
使用用户名nagiosadmin创建htdigest密码文件
htdigest -c /etc/nagios/.htdigestpasswd "Restricted Nagios Access Zone" nagiosadmin chmod 600 /etc/nagios/.htdigestpasswd
配置/etc/httpd/conf.d/nagios.conf文件。
编辑下面行
AuthType Digest AuthUserFile /etc/nagios/.htdigestpasswd AuthName "Restricted Nagios Access Zone" require valid-user
下面是nagios.conf配置文件参考
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/ <Directory /usr/lib64/nagios/cgi-bin/> Options ExecCGI order deny,allow deny from all allow from 127.0.0.1 AuthType Digest AuthUserFile /etc/nagios/.htdigestpasswd AuthName "Restricted Nagios Access Zone" require valid-user </Directory> Alias /nagios/ /usr/share/nagios/html/ <Directory /usr/share/nagios/html/> Options None order deny,allow deny from all allow from 127.0.0.1 AuthType Digest AuthUserFile /etc/nagios/.htdigestpasswd AuthName "Restricted Nagios Access Zone" require valid-user </Directory>