Renamed chkpw to chkpwd. (1.3.0)

This commit is contained in:
Johannes Findeisen 2025-06-04 18:43:26 +02:00
commit a2bcc55b38
6 changed files with 61 additions and 61 deletions

View file

@ -1,8 +1,8 @@
# chkpw
# chkpwd
chkpw is a program that checks the validity of a users password on a UNIX/[PAM](https://en.wikipedia.org/wiki/Pluggable_Authentication_Module)-based system.
chkpwd is a program that checks the validity of a users password on a UNIX/[PAM](https://en.wikipedia.org/wiki/Pluggable_Authentication_Module)-based system.
Currently chkpw is only tested on Linux, but it should work on a [AIX](https://en.wikipedia.org/wiki/IBM_AIX), [DragonFly BSD](https://www.dragonflybsd.org/), [FreeBSD](https://www.freebsd.org/), [HP-UX](https://en.wikipedia.org/wiki/HP-UX), [Linux](https://kernel.org/), [macOS](https://en.wikipedia.org/wiki/MacOS), [NetBSD](https://netbsd.org/) and [Solaris](https://en.wikipedia.org/wiki/Oracle_Solaris) operating system too.
Currently chkpwd is only tested on Linux, but it should work on a [AIX](https://en.wikipedia.org/wiki/IBM_AIX), [DragonFly BSD](https://www.dragonflybsd.org/), [FreeBSD](https://www.freebsd.org/), [HP-UX](https://en.wikipedia.org/wiki/HP-UX), [Linux](https://kernel.org/), [macOS](https://en.wikipedia.org/wiki/MacOS), [NetBSD](https://netbsd.org/) and [Solaris](https://en.wikipedia.org/wiki/Oracle_Solaris) operating system too.
## The idea
@ -12,35 +12,35 @@ I needed a program to verify passwords of users on Linux/UNIX systems using PAM
You need the PAM development package installed. On Alpine it is named linux-pam-dev, on Debian based systems it is libpam0g-dev.
## Building chkpw
## Building chkpwd
```
git clone https://git.xw3.org/hanez/chkpw.git
cd chkpw
git clone https://git.xw3.org/hanez/chkpwd.git
cd chkpwd
make
```
The code only supports verifying passwords for user id 1000 by default. Look at the file chkpw.h for some compile time options!
The code only supports verifying passwords for user id 1000 by default. Look at the file chkpwd.h for some compile time options!
### Custom build example
Set MAX_UID and MIN_UID at compile time:
```
gcc -Wall -DMAX_UID=1000 -DMIN_UID=1000 -o chkpw chkpw.c -lpam -lpam_misc
gcc -Wall -DMAX_UID=1000 -DMIN_UID=1000 -o chkpwd chkpwd.c -lpam -lpam_misc
```
## Installation
**WARNING:** Install this software with care. chkpw could easily be used for bruteforcing passwords from local users!
**WARNING:** Install this software with care. chkpwd could easily be used for bruteforcing passwords from local users!
```
sudo make install
```
chkpw is installed to /usr/bin/.
chkpwd is installed to /usr/bin/.
chkpw.h is installed to /usr/include/ for use in other applications.
chkpwd.h is installed to /usr/include/ for use in other applications.
## Uninstall
@ -51,8 +51,8 @@ sudo make uninstall
## Usage
```
chkpw -h
Usage: chkpw [-u <username>] [-p <password>] [-v] [-V] [-h]
chkpwd -h
Usage: chkpwd [-u <username>] [-p <password>] [-v] [-V] [-h]
Options:
-u <username> Set username.
@ -62,15 +62,15 @@ Options:
-h Show this help.
```
You can also use chkpw even without installing by just running the following command:
You can also use chkpwd even without installing by just running the following command:
```
./chkpw
./chkpwd
```
### Return codes
chkpw returns 0 on success, 1 otherwise.
chkpwd returns 0 on success, 1 otherwise.
### Examples
@ -78,19 +78,19 @@ chkpw returns 0 on success, 1 otherwise.
#### Interactive mode asking for a username and a password
```
chkpw
chkpwd
```
#### Interactive mode only asking for a password
```
chkpw -u hanez
chkpwd -u hanez
```
#### None interactive mode with username and password provided as arguments to chkpw
#### None interactive mode with username and password provided as arguments to chkpwd
```
chkpw -u hanez -p password
chkpwd -u hanez -p password
```
#### Request the result from the above commands
@ -101,14 +101,14 @@ echo $?
## License
chkpw is licensed under the Apache License, Version 2.0.
chkpwd is licensed under the Apache License, Version 2.0.
See LICENSE for details.
## Links
- [https://git.xw3.org/hanez/chkpw](https://git.xw3.org/hanez/chkpw)
- [https://linux.die.net/man/8/unix_chkpwd](https://linux.die.net/man/8/unix_chkpwd)
- [https://git.xw3.org/hanez/chkpwd](https://git.xw3.org/hanez/chkpwd)
- [https://linux.die.net/man/8/unix_chkpwdd](https://linux.die.net/man/8/unix_chkpwd)
- [https://cr.yp.to/checkpwd.html](https://cr.yp.to/checkpwd.html)
- [https://pamtester.sourceforge.net/](https://pamtester.sourceforge.net/)