Help with htpasswd

  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 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
Code: [ Select ]
.htpasswd
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
  • Graduate
  • harryhood
  • Posts: 141

Post 3+ Months Ago

are you trying ls -a?
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Im not sure what that is. Could you explain please?
  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 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"
  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 3+ Months Ago

Sample:
Code: [ Select ]
[root@aux leandro]# pwd
/home/leandro
[root@aux leandro]# ls
public_html
[root@aux leandro]# ls -la
total 40
drwx--x--x  4 leandro leandro   4096 Apr 20 2003 .
drwxr-xr-x  10 root   root     4096 Aug 1 2003 ..
-rw-r--r--  1 leandro leandro    24 Aug 24 2002 .bash_logout
-rw-r--r--  1 leandro leandro    191 Aug 24 2002 .bash_profile
-rw-r--r--  1 leandro leandro    124 Aug 24 2002 .bashrc
-rw-r--r--  1 leandro leandro    820 Aug 24 2002 .emacs
-rw-r--r--  1 leandro leandro    118 Aug 24 2002 .gtkrc
drwxr-xr-x  3 leandro leandro   4096 Aug 24 2002 .kde
drwxr-xr-x  2 leandro leandro   4096 Aug 24 2002 public_html
-rw-r--r--  1 leandro leandro   3511 Aug 24 2002 .screenrc
[root@aux leandro]#
  1. [root@aux leandro]# pwd
  2. /home/leandro
  3. [root@aux leandro]# ls
  4. public_html
  5. [root@aux leandro]# ls -la
  6. total 40
  7. drwx--x--x  4 leandro leandro   4096 Apr 20 2003 .
  8. drwxr-xr-x  10 root   root     4096 Aug 1 2003 ..
  9. -rw-r--r--  1 leandro leandro    24 Aug 24 2002 .bash_logout
  10. -rw-r--r--  1 leandro leandro    191 Aug 24 2002 .bash_profile
  11. -rw-r--r--  1 leandro leandro    124 Aug 24 2002 .bashrc
  12. -rw-r--r--  1 leandro leandro    820 Aug 24 2002 .emacs
  13. -rw-r--r--  1 leandro leandro    118 Aug 24 2002 .gtkrc
  14. drwxr-xr-x  3 leandro leandro   4096 Aug 24 2002 .kde
  15. drwxr-xr-x  2 leandro leandro   4096 Aug 24 2002 public_html
  16. -rw-r--r--  1 leandro leandro   3511 Aug 24 2002 .screenrc
  17. [root@aux leandro]#

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
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 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
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 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
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 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
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 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
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 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
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 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.
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

in what file do I place the following?
Code: [ Select ]
<Directory "/usr/local/apache/htdocs">
AllowOverride Options
</Directory>
  1. <Directory "/usr/local/apache/htdocs">
  2. AllowOverride Options
  3. </Directory>
I think that is what I am missing

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 62 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.