Add cp, folder mv, get -r, and unlock/lock to remember the key
Filesystem basics: mv now moves folders as well as files, and like mv(1) a NEW ending in / or naming an existing folder means into it. cp copies a file, or a folder with -r, by writing new records that share the original's objects, so it is instant and takes no space; rm already keeps objects another record still uses. New records go first, so an interrupted move leaves both names, never neither. get -r extracts a folder, keeping its structure. vault unlock [--for 5m] checks the passphrase and starts the binary again as a hidden __agent process, handing it the suite ID and seed over a pipe. The agent keeps them in mlocked memory, with core dumps off and (on Linux) PR_SET_DUMPABLE cleared, serves them on a Unix socket in a 0700 per-user directory whose owner is checked on every use, and wipes them and exits at a hard deadline or on vault lock. Commands ask it first unless VAULT_PASSPHRASE is set, and genkey stops any agent left for that path. Guide, man pages (new vault-cp, vault-unlock, vault-lock), README and screenshots updated; the guide's error table is split so it fits.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
.TH VAULT-UNLOCK 1 "October 2026" "vault" "User Commands"
|
||||
.SH NAME
|
||||
vault-unlock, vault-lock \- remember the unlocked key for a while, or forget it
|
||||
.SH SYNOPSIS
|
||||
.B vault unlock
|
||||
.RB [ \-\-for
|
||||
.IR DURATION ]
|
||||
.RB [ \-\-key
|
||||
.IR PATH ]
|
||||
.br
|
||||
.B vault lock
|
||||
.RB [ \-\-key
|
||||
.IR PATH ]
|
||||
.SH DESCRIPTION
|
||||
.B unlock
|
||||
asks for the passphrase, checks it, and starts a helper process, much like
|
||||
.BR ssh\-agent (1),
|
||||
that holds the unlocked key in memory until \fIDURATION\fR has passed
|
||||
(default 5m). Until then every command using the same key file skips the
|
||||
passphrase prompt. The deadline is fixed when you unlock; using the key does
|
||||
not extend it. Running
|
||||
.B unlock
|
||||
again replaces the helper with a fresh one.
|
||||
.PP
|
||||
.B lock
|
||||
tells the helper to wipe the key and exit at once.
|
||||
.PP
|
||||
The key reaches the helper over a pipe and is never written to disk. Its
|
||||
memory is locked against swapping and excluded from core dumps; on Linux the
|
||||
helper is also not debuggable. It answers only on a Unix socket inside
|
||||
\fI$XDG_RUNTIME_DIR/vault-UID\fR (or the temporary directory), a directory
|
||||
that must belong to this user with mode 0700. Rebooting ends it too.
|
||||
.PP
|
||||
While the key is unlocked, any program running as this user can use it, and
|
||||
it is whichever key the passphrase opened, real or decoy. Lock before
|
||||
handing the machine to anyone.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-\-for " DURATION"
|
||||
How long to remember the key, such as 90s, 5m or 2h. Default 5m.
|
||||
.PP
|
||||
See also \fB\-\-key\fR in
|
||||
.BR vault (1).
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B VAULT_PASSPHRASE
|
||||
Passphrase for
|
||||
.BR unlock .
|
||||
When set for any other command, it is used instead of the remembered key.
|
||||
.TP
|
||||
.B XDG_RUNTIME_DIR
|
||||
Where the helper's socket directory goes.
|
||||
.SH SEE ALSO
|
||||
.BR vault (1),
|
||||
.BR ssh\-agent (1)
|
||||
.SH AUTHOR
|
||||
Andy Dixon <vault@dixon.cx>, https://www.dixon.cx
|
||||
Reference in New Issue
Block a user