【基本介绍】
这里介绍nagios添加用户和用户权限管理
【基本配置】
1. 用户添加 2. 用户权限管理
1. 用户添加
用户是由web服务器提供的用户管理。
例如apache里面:用户和密码是有AuthUserFile配置文件来管理。
<VirtualHost *:80>
DocumentRoot /usr/local/nagios/share
ServerName xxxxx.com
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
</VirtualHost>
用户密码配置文件:用户名:密码
[root@nagioscn etc]# cat /usr/local/nagios/etc/htpasswd.users
nagiosadmin:$apr1$M0Sez/..$Q8AqOHqxIJiE6ETuM9FSx0
viewer:OIC0OF3rCMztE
2. 用户权限是有nagios来管理访问nagios的权限
配置文件:/usr/local/nagios/etc/cgi.cfg
use_authentication=1 #是否开启用户认证
use_ssl_authentication=0 #是否允许使用x509cert(SSL)
#default_user_name=guest #默认用户无需认证
authorized_for_system_information=nagiosadmin,admin #系统信息的访问权限
authorized_for_configuration_information=nagiosadmin,admin #配置信息的访问权限
authorized_for_system_commands=nagiosadmin,admin #配置系统命令的访问权限
authorized_for_all_services=nagiosadmin,admin,guest,viewer #全局services的访问权限
authorized_for_all_hosts=nagiosadmin,admin,guest,viewer #全局hosts的访问权限
authorized_for_all_service_commands=nagiosadmin,admin #全局services命令的访问权限
authorized_for_all_host_commands=nagiosadmin,admin #全局hosts命令的访问权限
authorized_for_read_only=guest,viewer #配置只读用户的访问权限
【htpasswd】
htpasswd用户创建用户和密码配置文件
[root@nagioscn etc]# htpasswd -h
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password.
-d Force CRYPT encryption of the password (default).
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
分享到:
相关推荐
Nagios的Web插件通常位于`plugins`目录下,将其安装到适当的位置,例如`/usr/lib64/nagios/plugins`,并确保Nagios用户有执行权限。此外,还需要配置Apache或Nginx等HTTP服务器,将Nagios的Web界面指向Nagios的HTML...
./configure --with-httpd-conf=/etc/apache2/sites-enabled/ --with-nagios-user=nagios --with-nagios-group=nagios make all sudo make install ``` - 对于中文版,你需要先从Nagios官方网站或者第三方源...
- `./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/local/ssl` - `make all` - `make install` - `make install-daemon` - `make install-daemon-config` - 启动NRPE服务...
为Nagios创建一个专用的运行用户和组,并将Apache用户添加到该组,以便能访问Nagios的目录。 ``` [root@nagios ~]# useradd nagios [root@nagios ~]# usermod –G nagios apache ``` 3. **安装Nagios** 下载...
- 将`User daemon`和`Group daemon`修改为`User nagios`和`Group nagios`。 - 修改`DirectoryIndex index.html`为`DirectoryIndex index.html index.php`。 - 添加对PHP的支持。 - ``` AddType application/x-...
本安装手册将指导你如何在CentOS 6.0上安装和配置Nagios,包括必要的依赖软件、Nagios主程序和插件的安装,以及用户创建和配置文件的检查。 首先,你需要下载CentOS 6.0的ISO镜像,并使用VMware安装系统。在中国,...
2. 创建一个名为`nagios`的用户,以便运行Nagios服务,并将Apache用户添加到`nagios`组中,以允许Web界面的正常操作: ```bash [root@nagios ~]# useradd nagios [root@nagios ~]# usermod –G nagios apache `...
[root@nagios nagios-plugins-2.3.2]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios ``` 4. **安装**: ```bash [root@nagios nagios-plugins-2.3.2]# make all [root@nagios nagios-...
cd /usr/src && tar xzvf nagios-plugins-1.4.13.tar.gz && cd nagios-plugins-1.4.13 && ./configure --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/usr/local/nagios && make && make install...
- `./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagcmd --with-command-user=nagios --with-command-group=nagcmd`: 配置插件安装路径及用户信息。 - `make`: 编译插件...
- `./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-command-group=nagcmd` - `make all` - `make install` - `make install-init` - `make install-config` - `make install-...
- **创建用户和组**:接下来,创建一个名为`nagios`的用户和一个名为`nagcmd`的组,并将`nagios`和`apache`用户添加到`nagcmd`组。 ```bash /usr/sbin/useradd -m nagios passwd nagios # 输入密码 sunagios ...
1. 添加Apache用户和组: ``` # useradd apache -g daemon -M ``` 2. 编辑Apache配置文件,修改User和Group: ``` # vi /usr/local/apache/conf/httpd.conf ``` 找到`User xxx`和`Group xxx`行,将其改为`User ...
将`nagios`用户和`apache`用户添加到这个组: ```bash /usr/sbin/groupadd nagcmd /usr/sbin/usermod -a -G nagcmd nagios /usr/sbin/usermod -a -G nagcmd apache ``` 接下来,下载Nagios和Nagios插件的源代码。...
usermod -a -G nagcmd nagios # 将用户nagios添加到组nagcmd usermod -a -G nagcmd apache # 将用户apache添加到组nagcmd ``` 2. **设置密码**: ```bash passwd nagios ``` #### 四、GD 库安装 GD 库用于...
3. **创建Nagios组**:创建一个名为`nagcmd`的组,用于管理Nagios命令执行权限,并将`nagios`和`apache`用户添加到该组中: ```bash groupadd nagcmd usermod -G nagcmd nagios usermod -G nagcmd apache ``` ...