LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-13-2011, 10:12 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Rep: Reputation: Disabled
binding htpasswd username and password with specific IP addresses


Hi..all, I added these below four lines in the document root section in /etc/apache2/sites-available/default file on ubuntu-11.04.
AuthType Basic
AuthName "Authorised Users Only"
AuthUserFile /etc/.auth_users
Require valid-user
Then I added users using "htpasswd -c /etc/.auth_users user1", "htpasswd /etc/.auth_users user2" and so on. Also changed the permission as "chmod 640 /etc/.auth_users" & "chown root.www-data /etc/.auth_users". Then restarted apache. Now the server is prompting for username & password.
Good, but I need some more security for our web server that as I need to bind each and every username(which is stored in /etc/.auth_users file) with particular IP address. Then other person will not be able to browse on other machine even the username and password get hacked. Is it possible to do so?
And is it possible to create groups and grant the permission as read only or read/write. Because we are running wiki pages and by default edit button is enabled. So anyone can edit or delete anything. I don't have much idea about pmwiki. I will be waiting for your kind response.

Regards
Roopa
 
Old 09-13-2011, 12:00 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
http://httpd.apache.org/docs/2.2/mod...uthz_host.html
This limits group access by host or ip address.
If each valid user has a different ip address, then make each user a member of their own group.
 
1 members found this post helpful.
Old 09-13-2011, 11:47 PM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
binding htpasswd username and password with specific IP addresses

Thanks for your kind reply.
I saw the url, still I need some more explanation for below doubts.
Instead of showing all ip in the /etc/apache2/sites-available/default file as "Allow from 192.168.0.2 192.168.0.3 192.168.0.4 and so on" to allow only this particular IPs, is it possible to show as a file i.e "Allow from /etc/.auth_IPs" in which Allowed IP addresses will be stored?
I will create group file as /etc/.auth_group. In this file how to add group name, what is the command to add group name like htpasswd. or simply can I write the group name? And after how to add users to those group using htpasswd.
How to integrate particular user name with particular IP address?

Quote:
Originally Posted by smoker View Post
http://httpd.apache.org/docs/2.2/mod...uthz_host.html
This limits group access by host or ip address.
If each valid user has a different ip address, then make each user a member of their own group.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding 2 NICs (MAC addresses) to 2 IP Addresses in same Subnet RedHat EL4.0 skhira Linux - Networking 13 02-24-2008 08:16 PM
Binding 2 NICs (MAC addresses) to 2 IP Addresses in same Subnet RedHat EL4.0 skhira Linux - Networking 1 02-09-2008 07:17 AM
Binding multiple IP Addresses to same NIC Harlin Linux - Networking 4 10-26-2005 05:10 AM
Binding multiple IP addresses to a nic card Natalie Linux - Networking 9 08-12-2003 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration