【基本介绍】
这里介绍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>
用户密码配置文件:用户名:密码
[iyunv@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用户创建用户和密码配置文件
[iyunv@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.
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com