Q: Need to use a default user, but still allow changing to another user

Richard Mohr rfmohr at osc.edu
Thu Mar 27 22:51:18 CET 2008


On Tue, 2008-03-18 at 09:25 -0600, Cary Petterborg wrote:
> We are trying to make things easy for "managers" who want to look at
> statuses without logging in (it is a request by the managers, not
> something WE thought up on our own to help them). This can be done by
> setting a default user, right? So you set the default user, but then you
> can't log in as a different user to get different views, etc.
> 
> Does anyone have a solution that they are using for this type of case? I
> know I can get around this doing some programming, but if someone
> already cracked this nut, it would save me a lot of time for other work.

Here is one idea that might work for you:

Configure Apache so that connections to port 80 (HTTP) do not require
authentication. (They could still be restricted to internal subnets.)
Nagios cgis should then use the default user for access.  Then configure
apache so that connections to port 443 (HTTPS) always require
authentication.  Below is a rough idea of what that might look like
(although it is incomplete so it won't work as is):

Listen 10.0.0.1:80
<VirtualHost 10.0.0.1:80>
    ServerName www.foo.com

    <Location /nagios>
        Deny from all
        Allow from 10.0.0.0
    </Location>
</VirtualHost>

Listen 10.0.0.1:443
<VirtualHost 10.0.0.1:443>
    ServerName www.foo.com
    SSLEngine on
    <Location /nagios>
        SSLRequireSSL
        AuthName "Nagios"
        AuthType Basic
        AuthUserFile /path/to/htpasswd/file
        Require valid-user
    </Location>
</VirtualHost>

Then just tell your managers to bookmark two URLs:
http://www.foo.com/nagios (for unauthenticated access) and
https://www.foo.com/nagios (for restricted login access).  That might
satisfy them.

-- 
Rick Mohr
Systems Developer
Ohio Supercomputer Center


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list