SWADPW(1)

NAME

swadpw
Password file management tool for SWAD

SYNOPSIS

swadpw
-V
swadpw
-h
swadpw
[-abdsy] -f file [-c cost] [-n name] user

DESCRIPTION

swadpw allows to create and edit password files for swad(8) to be used with its file credential checker. It uses bcrypt password hashes in flavors $2b$ or $2y$. They are internally the same, $2b$ is the default of OpenBSD's bcrypt implementation used by swad(8), while $2y$ is what Apache uses.

Files created by swadpw are fully compatible with Apache's .htpasswd format when the $2y$ hash flavor is chosen and no real names are given for users.

In the standard mode of operation, passwords are expected to be typed on a terminal. The terminal's local echo is disabled for typing a password, IOW, you can't see what you type. Therefore, you have to type the password twice to make sure it was typed correctly. The only way to correct typing errors is the "backspace" key, all other control characters aren't handled and will mess up what you typed.

The options are as follows:

-a

Add a new user to the password file. Fails if the user already exists.

default:

Edit an existing user, fail if the user doesn't exist.

-b

Always use the OpenBSD flavor for bcrypt hashes ($2b$).

default:

Prefer OpenBSD, but leave Apache flavor ($2y$) when editing.

-c cost

Set the cost factor for newly created bcrypt password hashes. The time needed to hash a password grows exponentially with this factor. For sensible password security, a factor of at least 12 is recommended nowadays. Setting the factor too high will cause significant CPU load for every user login.

min:

10

max:

99

default:

12

-d

Delete the given user from the password file. Fails if the user doesn't exist.

-f file

Path to the password file to edit or create.

-h

Print a help text and exit.

-n name

Set an optional real name name for the user added or edited.

-s

Allow reading the password from plain standard input if not connected to a terminal. This is required to use swadpw in a pipe.

default:

Fail when standard input is not a terminal.

-V

Print version information and exit.

-y

Always use the Apache flavor for bcrypt hashes ($2y$).

default:

Prefer OpenBSD ($2b$), but leave Apache flavor when editing.

user

The user to add or modify.

Additional information

Version:
swadpw v0.6
License:
BSD 2-clause (all rights reserved)
WWW:
https://github.com/Zirias/swad

SEE ALSO

swad(8)

AUTHORS

Felix Palmen <felix@palmen-it.de>