【问题标题】:nagios-cgi password screen bypassnagios-cgi 密码屏幕绕过
【发布时间】:2014-09-19 07:23:18
【问题描述】:

我正在尝试设置一个 bash 脚本来安装 nagios3 及其所有依赖项。我明白了:

apt-get install -y nagios3

负责所有这些。

现在我担心的是绕过 nagios3-cgi 的设置屏幕 到目前为止我有这个:

#!/bin/bash

PASS="0"
REPASS="1"
while [ $PASS != $REPASS ]; do
    read -s -p "Password: " PASS; echo
    read -s -p "Retype: " REPASS; echo
done

debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
apt-get install -y postfix

apt-get install -y  nagios3

我能够通过以下方式绕过 postfix conf 屏幕:

debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"

我怎样才能用 nagios3-cgi 做同样的事情?

我试过了,但没用:

mkdir /etc/nagios3
htpasswd -cb /etc/nagios3/htpasswd.users nagiosadmin $PASS

【问题讨论】:

    标签: bash ubuntu automation passwords


    【解决方案1】:

    我解决了我自己的问题。

    首先我在虚拟机上正常安装了 nagios3 然后我用了

    debconf-get-selections > file.txt
    debconf-get-selections >> file.txt
    

    这会将所有安装详细信息写入 file.txt

    然后在文件中搜索 nagios3-cgi 配置

    我发现我需要的配置文件的名称是

    nagios3-cgi nagios3-cgi/adminpassword
    

    nagios3-cgi nagios3-cgi/adminpassword-retype
    

    然后我做了与安装 posfix 相同的事情。 这是我的最终剧本。真的很简单。

    PASS="0"
    REPASS="1"
    
    
    #Password loop
    while [ $PASS != $REPASS ]; do
        read -s -p "Nagios Password: " PASS; echo
        read -s -p "Retype Nagios Password: " REPASS; echo
    done
    
    sudo debconf-set-selections <<< "postfix postfix/mailname string diggalabs.com"
    sudo debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
    sudo debconf-set-selections <<< "nagios3-cgi nagios3/adminpassword string $PASS"
    sudo debconf-set-selections <<< "nagios3-cgi nagios3/adminpassword-repeat string $PASS"
    
    
    sudo apt-get install -y nagios3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-29
      • 1970-01-01
      • 2014-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-11
      • 2021-12-03
      相关资源
      最近更新 更多