How do I force someone to login for a webpage?
Specifically, I have a linux server, where everyone has a login to that server. Can I make users login to the webpage with that login info?
If I can't use that apporach, what are my other options?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Assuming you are using apache, then you could use the mod_auth_pam module to use the local system for authentication.
At least on Debian/Ubuntu you would need to add the www-data to the shadow group (/usr/sbin/adduser www-data shadow).
You would also need to add a section to your apache configuration like this.
<Location /> # libapache2-mod-auth-pam is required AuthBasicAuthoritative Off AuthPAM_Enabled on AuthUserFile /dev/null AuthType Basic AuthName "PAM" Require valid-user Order Deny,Allow Deny from all Satisfy Any </Location>
You should also strongly consider setting up SSL so your system passwords will not be stolen by someone with a sniffer.
If you want to build it into your website, you can build in session management and protect the content that you want.
If you want to give them file access, you may want to look at samba instead.
Just to be sure, are you trying to get people to login to the server and access the server's resources (file shares, etc) by only logging into a webpage and not into the server it self?
If you want people to be able to login using their server login credentials then take a look at http://code.google.com/p/mod-auth-external/
As other people have mentioned there is also mod_auth_pam but that isn't developed any more but might work for you. As ever YMMV :)