C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » WCF/Webservices »

Password protecting Web directories : Linux


Posted Date: 09 Dec 2007    Resource Type: Articles    Category: WCF/Webservices
Author: Arvind KukretiMember Level: Bronze    
Rating: 1 out of 5Points: 10



Introduction



Password protecting Web directories : Linux



Summary



To password protect a directory:

1. In a text editor, create a file named .htaccess.
2. Insert the following lines into the file, making the appropriate replacements.


AuthUserFile /home/[domainname]/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

require user [username]


3. Save the file as plain text & then upload it via FTP in ASCII mode to the following location:

/www/[domainname]/[directoryname]/

4. Log onto the server via SSH.
5. At the command prompt, issue the following command:

   htpasswd -c /home/[domainname]/.htpasswd [username] 


This creates a file named .htpasswd in your home directory.

6. When you are prompted for a password, enter the password to associate with this user.
7. To grant access to another user, add the following line to the .htaccess file:

require user [username2]

8. Save & upload the file as you did in step 3.
9. Log onto the server via SSH & issue the following command:

      htpasswd /home/[domainname]/.htpasswd [username2] 



Note: For security purposes, you should store the .htpasswd file in your home directory.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Password protecting Web directories  .  Linux  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Cross – Domain Messaging
Previous Resource: Issue of changing IPAddress programatically in windows vista
Return to Discussion Resource Index
Post New Resource
Category: WCF/Webservices


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use