LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-04-2005, 03:08 PM   #1
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Rep: Reputation: 0
htpasswd


I'm trying to use htpasswd on a single file, but cannot seem to get it running.

I used the following line.

htpasswd examsintlaw.html gil password



Can any of you help? It would be greatly appreciated.
 
Old 10-04-2005, 03:25 PM   #2
pr0gm3r
Member
 
Registered: Nov 2003
Location: CA
Distribution: SuSE 10.2
Posts: 35

Rep: Reputation: 15
I think you need to put the options

Code:
htpasswd [ -c ] [ -m | -d | -s | -p ]
please check the manual for htpasswd
 
Old 10-04-2005, 05:22 PM   #3
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Can HTPASSWD even be applied to a html file? Or does it have to be applied to a folder, and it would password-protect all files within.
 
Old 10-06-2005, 05:27 PM   #4
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I still haven't got this going yet. Any ideas/suggestions?
 
Old 10-06-2005, 05:37 PM   #5
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 956

Rep: Reputation: 34
might seem obvious but
HTPASSWD --help
might provide some clues to how to get it to work
 
Old 10-07-2005, 02:48 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,894

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
htpasswd is a utility to create passwords for the users you want to access certain files/directories of your webserver. Then you create a .htaccess file in the directory you want to password-protect.
To protect just a file your .htaccess must be something like this:
Code:
<Files examsintlaw.html>
    AuthType Basic
    AuthName "Whatever you want"
    AuthUserFile /absolute_path/to_password_file
    Require user username
</Files>
 
Old 10-07-2005, 01:52 PM   #7
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Ċrhus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 588

Rep: Reputation: 45
Does your apache configuration allow you to restrict the access?

Ott
 
Old 10-24-2005, 10:42 AM   #8
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I checked AllowOverride. I set it to both allow, deny, none. But I still can't get .htaccess/.htpasswd going.
 
Old 10-24-2005, 10:49 AM   #9
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Also, would .htpasswd be in the same directory as everything else that I want to password protect along with .htaccess.
 
Old 10-24-2005, 12:05 PM   #10
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,894

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Try
Code:
AllowOverride AuthConfig
Also .htaccess protects the directory where it's located and any subdir under that directory
 
Old 11-01-2005, 10:08 AM   #11
integra_twinz
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by bathory
Try
Code:
AllowOverride AuthConfig
Also .htaccess protects the directory where it's located and any subdir under that directory

Thanks a whole bunch. That was the resolution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
.htaccess .htpasswd plisken Linux - General 5 05-21-2006 01:44 PM
.htpasswd failure knight01 Fedora 6 12-05-2004 03:11 PM
htpasswd problems!!!! elam Linux - Software 1 05-15-2004 03:09 AM
Help with .htpasswd and .htaccess MikeeX Linux - General 3 03-25-2003 10:41 AM
htpasswd steve_c Linux - General 10 04-16-2002 10:15 AM


All times are GMT -5. The time now is 12:48 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration