给Linux监控软件Monitorix 3.5添加登录认证密钥

给Linux监控软件Monitorix 3.5添加登录认证密钥 monitorix是一个不错的Linux系统监控软件。很多可能不懂E文的朋友不知道怎么给Monitorix添加登录密钥。下面就来简单介绍下吧Monitorix 安装的很简单不懂可以留言相关配置文件部分httpd_builtin enabled y host port 8080 user nobody group nogroup log_file /var/log/monitorix-httpd hosts_deny hosts_allow auth enabled y # 这里要改为y msg Monitorix: Restricted access htpasswd /var/lib/monitorix/htpasswd /auth /httpd_builtin老外的英文密钥相关在这htpasswdThis option sets the path to the password file that was created with the help of thehtpasswd.plscript. That script encrypts and validates passwords using the system’s crypt() routine. If your Monitorix package doesn’t come with that script, you may use the similarhtpasswd(1) program provided with the Apache web server.The format of the password file consist of one or more lines with a username and password separated by a colon.The following is an example of a password file:paul:oGkEsQK6RYIIIpeter:HF1r7qRL4Kg6ESince the script uses the crypt() algorithm, only the first 8 characters of the password are used to form the password. If the supplied password is longer, the extra characters will be silently discarded.Default value:/var/lib/monitorix/htpasswd其实很多人卡壳就在怎么生成密钥下面本人提供一个简单的Perl小脚本用来生成密钥添加到/var/lib/monitorix/htpasswd即可。#!/usr/bin/perl use strict; #http://www.zizaiyou.cn my $pw$ARGV[0]; print crypt($pw,$pw).\n;用法./passwd.pl 密码OK这样就可以了。