Go PassMngr implementation
The passmngr is composed of 2 binaries, a server and a client. The server cmd/pm-server/main.go
interacts with the encrypted database file directly and serves clients over a TLS secured unix socket. The client handles all terminal operations (i.e. user interactions) such as receiving the master password and launching the server binary and performing the get, set, delete, list, etc. operations.
The server should be build as pm-server
(go build -o pm-server ./cmd/pm-server
). The client will expect to find a pm-server
binary in the $PATH
. The client can be built with any name, but pm
is suggested (go build -o pm ./cmd/pm
). The usage of the client is:
Usage: pm OPERATION [options...]
Locking Operation: OPERATION [options...]
unlock Unlock a passmngr database and start a server.
lock Locks an open passmngr by shutting down the server
Passmngr Operations: OPERATION KEY_OR_PREFIX [options...]
list List all keys starting with a prefix
get Get a specified key
set Set a specified item
gen Generate a password for a specified key
delete Delete a specified key
General Options:
--socket Path to the passmngr server socket
Default: '~/.passmngr/socket'
Unlock Options:
--db Path to the passmngr database file
Default: '~/.passmngr/passmngr.db'
--max-unlock Maximum time the passmngr server can remain unlocked for
Default: 10m
--params.time Argon2ID password derivation time parameter.
Use this to tune the unlock time to something reasonable like 5s - 10s
Default: 16, Minimum: 1
--params.mem Argon2ID password derivation memory in KiB
Use this to tune unlocking to use a reasonable amount of memory like 1/16th of the system total
Default: 2 GiB, Minimum 1 MiB
Set Options:
-v Echo characters of the value as they are typed.
Use this as a convenience when entering non-sensitive info
Default: false
Generation Options:
-w Generate a word password. Mutually exclusive with -c
-c Generate a character password. Mutually exclusive with -w
--include An allowlist string of characters to include in a generated character password.
Default: 0123456789
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
,./;'[]\-=` + "`" + `<>?:\"{}|+_)(*&^%$#@!~
(All characters from a standard US Keyboard)
--exclude A blocklist of characters to exclude from the default character set.
--bits The entropy of the generated password in bits. Use this to control the final length.
Default: 92
--sep The string to seperate words with in a word password.
Default: ' ' (space)
Installation
The 2 components can be installed with go install gitlab.copi.dev/jcopi/passmngr-go/cmd/pm@latest
and go install gitlab.copi.dev/jcopi/passmngr-go/cmd/pm-server@latest
and adding the directory these are installed to (probably ~/go/bin/
) to the PATH