dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersNwe Nwe
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Resources » .NET programming » WCF/Webservices

Password protecting Web directories : Linux


Posted Date:     Category: WCF/Webservices    
Author: Member Level: Bronze    Points: 10


Creating password protected directories...for Linux hosting platform



 


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.





Did you like this resource? Share it with your friends and show your love!


Responses to "Password protecting Web directories : Linux"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Cross – Domain Messaging
    Previous Resource: Issue of changing IPAddress programatically in windows vista
    Return to Resources
    Post New Resource
    Category: WCF/Webservices


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Password protecting Web directories  .  Linux  .  



    Follow us on Twitter: https://twitter.com/dotnetspider

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.