LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   squid proxy authentication htpasswd command problem (https://www.linuxquestions.org/questions/linux-server-73/squid-proxy-authentication-htpasswd-command-problem-687651/)

sonykarthik71 12-02-2008 02:11 AM

squid proxy authentication htpasswd command problem
 
Hi,

I have installed squid in my vmware and its started and it is working in client side also with the proxy settings.But after that i try to set proxy NCSA authentication by using htpasswd command,its throughing out the error

bash:htpasswd command not found

what is the cause of this problem?How can i set the authentication now?

Regards,
Karthik

datopdog 12-02-2008 03:44 AM

htpassword is found in the httpd package if using centos/redhat and apache2-utils on debian

netkiller 12-02-2008 05:25 AM

actually, that passwd is crypt passwd.
has a lot of way to generate passwd.

you can see my document if you known chinese LOL.
http://netkiller.hikz.com/book/security/


the following is c language

[root@linux root]# cat crypt.c
/*
Netkiller 2003-06-27 crypt.c
char *crypt(const char *key, const char *salt);
*/
#include <unistd.h>
main(){
char key[256];
char salt[64];
char passwd[256];
printf("key:");
scanf("%s",&key);
printf("salt:");
scanf("%s",&salt);
sprintf(passwd,"passwd:%s\n",crypt(key,salt));
printf(passwd);
}
[root@linux root]# gcc -o crypt -s crypt.c –lcrypt
[root@linux root]# ./crypt
key:chen
salt:salt
passwd:sa0hRW/W3DLvQ
[root@linux root]#








# cat crypt.php

<html>

<p>DES 密码</p>

<form method=post action=crypt.php>

<p>password:<input name=passwd type=text size=20></p>

<input type=submit value=submit>

</form>

<?

$enpw=crypt($passwd);

echo "password is: $enpw";

?>









perl -e 'print("userPassword: ".crypt("secret","salt")."\n");'








mysql crypt

select encrypt('password');



mysql> select encrypt('password');

+---------------------+

| encrypt('password') |

+---------------------+

| WXvvG0CWY7v5I |

+---------------------+

1 row in set (0.00 sec)



mysql>


All times are GMT -5. The time now is 06:02 AM.