The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to require valid user/password?

Discussion in 'General Discussion' started by kosmo, Jun 24, 2002.

  1. kosmo

    kosmo Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    403
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    All over Europe
    Any idea how can I require valid unix user/password when entering a web page? I don't want my own list, I need access to the stored local users and the shadowed passwords. And I can't use port 2082, I need port 80.

    Thanks in advance.

    kosmo
     
  2. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    Naturally I posted this before I even realized what you were saying....... but if you want to always be in sync with local users, you can script something and cron it to look for a certain UID/GID within /etc/passwd and /etc/shadow, and then copy the necessary portions to the .htaccess/.htpasswd files in question.

    *There probably is a better way of doing this, somebody please enlighten us all* :p

    use .htaccess .......
    plenty of how-tos online.

    (using that functionality in the root of a site, aka their public_html dir, will require a login for the entire site)

    or you can do specific subdirs of course, etc, etc
     
  3. snowgod

    snowgod Well-Known Member

    Joined:
    Sep 23, 2001
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Unfortunatly, there is no good, safe way to do this for a script run under apache. On a quick glance through Google, I found http://pam.sourceforge.net/mod_auth_pam/

    This may be a good option if you run apache with suexec.

    Other than that, you don't have many good options.
     
Loading...

Share This Page