Help with htpasswd

SharkShark

Guru

Posts: 1013

Loc: Living In Today

3+ Months Ago

Hey guys,

Before a moderator says anything, yes i know something has been posted before, and yes I read it. I have been reading stuff for the past two days, and Im still having probs. Im probably just stupid as $#!%.

Anyway, I logged onto my server via Putty and using the htpasswd program attempted to create a

page. It then tells me that it is creating it, then it goes back to the prompt. But when I look there is no file. anywhere. I then tried making the file manually, but when i put it up, the login prompt refuses to acknowledge me. It will not accept my password no matter what. What the heck am I doing wrong? what code is missing? Or am I just stupid as sin, and shouldnt be trying this anyway. please hlep me guys. THankx

harryhood

Graduate

Posts: 141

3+ Months Ago

are you trying ls -a?

SharkShark

Guru

Posts: 1013

Loc: Living In Today

3+ Months Ago

Im not sure what that is. Could you explain please?

_Leo_

Proficient

Posts: 279

Loc: Buenos Aires, Argentina

3+ Months Ago

Files starting with period are hidden in unix for a normal directory listing. In the shell prompt, you type in "ls" and ENTER so you get the list of files inside a directory. To see hidden files also, you have to type in "ls -a"

As you can see, in the first directory listing request, only one directory is shown. But then, with -la modifier for the listing, there are a few more files starting with period.

SharkShark

Guru

Posts: 1013

Loc: Living In Today

3+ Months Ago

OK, I have no problems viewing the files. I found where they are all at on the server, My problem is getting it to accept the password. I just tried to set up a database with MYSQL on my server, and it told me that I am running Frontpage, and it cannot run htaccess IT therfore changed the names to htaccess.old What does that mean, and how can I work around this?

_Leo_

Proficient

Posts: 279

Loc: Buenos Aires, Argentina

3+ Months Ago

I don't know what are you talking about.

I mean, the htpasswd file is used by apache webserver for storing passwords in order to validate access restricted via "htaccess" file or web server configuration directives in the main configuratin file.

Therefore, htpasswd file has nothing to do with MySQL and FrontPage.

I think you may be trying to implement the wrong solution to your problem. By the way, you didn't talk about the problem you are trying to solve here. So, what do you need the htpasswd file for?

SharkShark

Guru

Posts: 1013

Loc: Living In Today

3+ Months Ago

oh Srry, I have recently placed a PHP calendar on my website. The calandar folder has whithin it a folder called admin. I want to password protect the admin folder using htpasswd/htaccess. I placed the htpasswd file in /home/admin. THe htaccess file is inside /home/admin/mainwebsite_html/calendar/admin. As far as I know i placed the proper code in the htaccess, because when i tr to enter a page within the admin folder, i get the login prompt. HOWEVER, it will not accept my password. no matter how hard I try. I even tried placing the htpasswd file in the same foler with the htaccess file. I still cant log in. i have both of them chmod'ed to 644. am i missing some permission, some code what?

_Leo_

Proficient

Posts: 279

Loc: Buenos Aires, Argentina

3+ Months Ago

Ok, that's a different situation

Well, there may be problems at differents points of the authentication process.
First of all, there are a couple of parameters to the htpasswd utility for stablishing the encryption method. If you fail to match the encryption method used by the webserver, it won't be able to match the password.
It is also possible that the webserver is not able to access the password file for path or permission problems.
Detecting such problems is difficult, I know that. You should check the error log of the server/virtual host to get information that can help you. I'm not sure if this errors are reported in detail by the apache.

SharkShark

Guru

Posts: 1013

Loc: Living In Today

3+ Months Ago

hmmmm........OK well I tried using the htpasswd utilityl on the werver to create the htpasswd file. But it will work. after i enter the password, and confirm, it tell me that it is creating te file, then it goes back to the begin prompt. I will check the error logs though and see what I come up with and let you know Thanks for your help so far!

_Leo_

Proficient

Posts: 279

Loc: Buenos Aires, Argentina

3+ Months Ago

I know the htpasswd utility is working, but... if the problem is with the password encryption, you won't notice that on htpasswd file creation.

The problem would be the apache won't read the password encrypted with the wrong method.