# htpasswd: Command not found



## Beeblebrox (Nov 19, 2011)

I have installed security/p5-Authen-Htpasswd and security/p5-Apache-Htpasswd (although they do the same thing I think) but I cannot get htpasswd to work; I get not found message. Searching in /usr with find brings nothing either. I do not have apache22 installed btw.


----------



## graudeejs (Nov 19, 2011)

They are simply perl modules.

Install security/py-htpasswd and run *htpasswd.py*


----------



## pbd (Nov 19, 2011)

/usr/local/sbin/htpasswd is part of all Apache ports (www/apache13, www/apache20, www/apache22).


----------



## Beeblebrox (Nov 19, 2011)

@pbd:


> part of all Apache ports


Right, but if you don't want Apache, you should be able to install stand-alone modules of htpasswd, of which there are several.

@graudeejs: Still getting:

```
htpasswd.py: Command not found
```
and "No match" when *#ls /usr/local/sbin/ht**


----------



## graudeejs (Nov 19, 2011)

this happens when you use c shell (csh|tcsh).
Run `% rehash` after installing apps


----------



## Beeblebrox (Nov 19, 2011)

I rehashed, in fact I did a new login from tty1 before I posted the above


----------



## graudeejs (Nov 19, 2011)

Works fine for me. Check your PATH environment variable


----------



## Beeblebrox (Nov 20, 2011)

okay it's in /usr/local/bin, but
[CMD=""]/usr/local/bin># ./htpasswd.py[/CMD]
still gives 
	
	



```
./htpasswd.py: Command not found
```
what the hell?


----------



## wblock@ (Nov 20, 2011)

Are you really looking for a python version of htpasswd?  Then usually that means the command interpreter specified in the first line of the file (the "shebang") is missing or in the wrong place.  Or maybe the wrong version, like python26 instead of python27.


----------



## kpa (Nov 20, 2011)

The security/py-htpasswd port installs /usr/local/bin/htpasswd with a shebang line


```
#!/usr/bin/python
```

No wonder it doesn't work :OOO, python on FreeBSD does not link /usr/bin/python to /usr/local/bin/python*.

Ask the maintainer of the port to fix it.


----------



## Beeblebrox (Nov 20, 2011)

@wblock:


> Are you really looking for a python version of htpasswd?


No, don't care - just looking for the minimal depends solution (instead of installing the whole Apache bundle). Can't say much about the python script in question, but since graudeejs has it working..? My file has:

```
#!/usr/bin/python
"""Replacement for htpasswd"""
```

@kpa: OK - I changed the 1st line in the script to local and it worked! 
	
	



```
#!/usr/local/bin/python
```


----------



## graudeejs (Nov 20, 2011)

kpa said:
			
		

> The security/py-htpasswd port installs /usr/local/bin/htpasswd with a shebang line
> 
> 
> ```
> ...



Holly. cow... How did I miss that one...

I'll fix asap

EDIT:
submitted pr with patch


----------



## chessmaster (Jan 31, 2012)

Beeblebrox said:
			
		

> @wblock:
> 
> No, don't care - just looking for the minimal depends solution (instead of installing the whole Apache bundle). Can't say much about the python script in question, but since graudeejs has it working..? My file has:
> 
> ...



Hey having the same problem as you. I installed security/p5-Authen-Htpasswd, security/p5-Apache-Htpasswd, and security/py-htpasswd. Getting the 
	
	



```
htpasswd: Command not found.
```


----------



## graudeejs (Feb 1, 2012)

`$ rehash`


----------



## chessmaster (Feb 1, 2012)

graudeejs said:
			
		

> `$ rehash`


Done that already command still not found.


----------



## chessmaster (Feb 1, 2012)

```
$ htpasswd
htpasswd: not found
$ rehash
rehash: not found
$ htpasswd
htpasswd: not found
$ htpasswd.py
htpasswd.py: not found
```


```
$pkg_info p5-Apache-Htpasswd-1.8 Manage Unix crypt-style password file
p5-Authen-Htpasswd-0.171 Authen::Htpasswd - interface to read and modify Apache .htp
```


----------



## SirDice (Feb 1, 2012)

chessmaster said:
			
		

> ```
> $ rehash
> rehash: not found
> ```


What shell are you using and what is your PATH set to?


----------



## chessmaster (Feb 1, 2012)

SirDice said:
			
		

> What shell are you using and what is your PATH set to?


I'm using the default shell tcsh. Also I see my path is 
	
	



```
/usr/local/bin/htpasswd.py
```


----------



## chessmaster (Feb 1, 2012)

Sorry, I figured out what I did wrong changed the path 
	
	



```
#vi /usr/local/bin/htpasswd.py
```
 to 
	
	



```
#!/usr/local/bin/python
```
 Thanks to the previous user.


----------



## graudeejs (Feb 1, 2012)

chessmaster said:
			
		

> Sorry, I figured out what I did wrong changed the path
> 
> 
> 
> ...



There was error in Makefile sed regex... I'll submit PR (again)


----------

